Lines Matching refs:dpi
3006 d_print_init (struct d_print_info *dpi, int options,
3009 dpi->options = options;
3010 dpi->len = 0;
3011 dpi->last_char = '\0';
3012 dpi->templates = NULL;
3013 dpi->modifiers = NULL;
3015 dpi->callback = callback;
3016 dpi->opaque = opaque;
3018 dpi->demangle_failure = 0;
3024 d_print_error (struct d_print_info *dpi)
3026 dpi->demangle_failure = 1;
3030 d_print_saw_error (struct d_print_info *dpi)
3032 return dpi->demangle_failure != 0;
3038 d_print_flush (struct d_print_info *dpi)
3040 dpi->buf[dpi->len] = '\0';
3041 dpi->callback (dpi->buf, dpi->len, dpi->opaque);
3042 dpi->len = 0;
3048 d_append_char (struct d_print_info *dpi, char c)
3050 if (dpi->len == sizeof (dpi->buf) - 1)
3051 d_print_flush (dpi);
3053 dpi->buf[dpi->len++] = c;
3054 dpi->last_char = c;
3058 d_append_buffer (struct d_print_info *dpi, const char *s, size_t l)
3063 d_append_char (dpi, s[i]);
3067 d_append_string (struct d_print_info *dpi, const char *s)
3069 d_append_buffer (dpi, s, strlen (s));
3073 d_last_char (struct d_print_info *dpi)
3075 return dpi->last_char;
3093 struct d_print_info dpi;
3095 d_print_init (&dpi, options, callback, opaque);
3097 d_print_comp (&dpi, dc);
3099 d_print_flush (&dpi);
3101 return ! d_print_saw_error (&dpi);
3162 d_lookup_template_argument (struct d_print_info *dpi,
3165 if (dpi->templates == NULL)
3167 d_print_error (dpi);
3172 (d_right (dpi->templates->template_decl),
3179 d_find_pack (struct d_print_info *dpi,
3189 a = d_lookup_template_argument (dpi, dc);
3205 return d_find_pack (dpi, dc->u.s_extended_operator.name);
3207 return d_find_pack (dpi, dc->u.s_ctor.name);
3209 return d_find_pack (dpi, dc->u.s_dtor.name);
3212 a = d_find_pack (dpi, d_left (dc));
3215 return d_find_pack (dpi, d_right (dc));
3238 d_print_subexpr (struct d_print_info *dpi,
3245 d_append_char (dpi, '(');
3246 d_print_comp (dpi, dc);
3248 d_append_char (dpi, ')');
3254 d_print_comp (struct d_print_info *dpi,
3259 d_print_error (dpi);
3262 if (d_print_saw_error (dpi))
3268 if ((dpi->options & DMGL_JAVA) == 0)
3269 d_append_buffer (dpi, dc->u.s_name.s, dc->u.s_name.len);
3271 d_print_java_identifier (dpi, dc->u.s_name.s, dc->u.s_name.len);
3276 d_print_comp (dpi, d_left (dc));
3277 if ((dpi->options & DMGL_JAVA) == 0)
3278 d_append_string (dpi, "::");
3280 d_append_char (dpi, '.');
3281 d_print_comp (dpi, d_right (dc));
3295 hold_modifiers = dpi->modifiers;
3302 d_print_error (dpi);
3306 adpm[i].next = dpi->modifiers;
3307 dpi->modifiers = &adpm[i];
3310 adpm[i].templates = dpi->templates;
3323 d_print_error (dpi);
3331 dpt.next = dpi->templates;
3332 dpi->templates = &dpt;
3351 d_print_error (dpi);
3357 dpi->modifiers = &adpm[i];
3361 adpm[i - 1].templates = dpi->templates;
3368 d_print_comp (dpi, d_right (dc));
3371 dpi->templates = dpt.next;
3380 d_append_char (dpi, ' ');
3381 d_print_mod (dpi, adpm[i].mod);
3385 dpi->modifiers = hold_modifiers;
3399 hold_dpm = dpi->modifiers;
3400 dpi->modifiers = NULL;
3404 if ((dpi->options & DMGL_JAVA) != 0
3412 d_print_comp (dpi, d_right (dc));
3413 d_append_string (dpi, "[]");
3417 d_print_comp (dpi, dcl);
3418 if (d_last_char (dpi) == '<')
3419 d_append_char (dpi, ' ');
3420 d_append_char (dpi, '<');
3421 d_print_comp (dpi, d_right (dc));
3424 if (d_last_char (dpi) == '>')
3425 d_append_char (dpi, ' ');
3426 d_append_char (dpi, '>');
3429 dpi->modifiers = hold_dpm;
3437 struct demangle_component *a = d_lookup_template_argument (dpi, dc);
3440 a = d_index_template_argument (a, dpi->pack_index);
3444 d_print_error (dpi);
3453 hold_dpt = dpi->templates;
3454 dpi->templates = hold_dpt->next;
3456 d_print_comp (dpi, a);
3458 dpi->templates = hold_dpt;
3464 d_print_comp (dpi, dc->u.s_ctor.name);
3468 d_append_char (dpi, '~');
3469 d_print_comp (dpi, dc->u.s_dtor.name);
3473 d_append_string (dpi, "vtable for ");
3474 d_print_comp (dpi, d_left (dc));
3478 d_append_string (dpi, "VTT for ");
3479 d_print_comp (dpi, d_left (dc));
3483 d_append_string (dpi, "construction vtable for ");
3484 d_print_comp (dpi, d_left (dc));
3485 d_append_string (dpi, "-in-");
3486 d_print_comp (dpi, d_right (dc));
3490 d_append_string (dpi, "typeinfo for ");
3491 d_print_comp (dpi, d_left (dc));
3495 d_append_string (dpi, "typeinfo name for ");
3496 d_print_comp (dpi, d_left (dc));
3500 d_append_string (dpi, "typeinfo fn for ");
3501 d_print_comp (dpi, d_left (dc));
3505 d_append_string (dpi, "non-virtual thunk to ");
3506 d_print_comp (dpi, d_left (dc));
3510 d_append_string (dpi, "virtual thunk to ");
3511 d_print_comp (dpi, d_left (dc));
3515 d_append_string (dpi, "covariant return thunk to ");
3516 d_print_comp (dpi, d_left (dc));
3520 d_append_string (dpi, "java Class for ");
3521 d_print_comp (dpi, d_left (dc));
3525 d_append_string (dpi, "guard variable for ");
3526 d_print_comp (dpi, d_left (dc));
3530 d_append_string (dpi, "reference temporary for ");
3531 d_print_comp (dpi, d_left (dc));
3535 d_append_string (dpi, "hidden alias for ");
3536 d_print_comp (dpi, d_left (dc));
3540 d_append_buffer (dpi, dc->u.s_string.string, dc->u.s_string.len);
3553 for (pdpm = dpi->modifiers; pdpm != NULL; pdpm = pdpm->next)
3563 d_print_comp (dpi, d_left (dc));
3583 dpm.next = dpi->modifiers;
3584 dpi->modifiers = &dpm;
3587 dpm.templates = dpi->templates;
3589 d_print_comp (dpi, d_left (dc));
3594 d_print_mod (dpi, dc);
3596 dpi->modifiers = dpm.next;
3602 if ((dpi->options & DMGL_JAVA) == 0)
3603 d_append_buffer (dpi, dc->u.s_builtin.type->name,
3606 d_append_buffer (dpi, dc->u.s_builtin.type->java_name,
3611 d_print_comp (dpi, d_left (dc));
3616 if ((dpi->options & DMGL_RET_POSTFIX) != 0)
3617 d_print_function_type (dpi, dc, dpi->modifiers);
3626 dpm.next = dpi->modifiers;
3627 dpi->modifiers = &dpm;
3630 dpm.templates = dpi->templates;
3632 d_print_comp (dpi, d_left (dc));
3634 dpi->modifiers = dpm.next;
3641 if ((dpi->options & DMGL_RET_POSTFIX) == 0)
3642 d_append_char (dpi, ' ');
3645 if ((dpi->options & DMGL_RET_POSTFIX) == 0)
3646 d_print_function_type (dpi, dc, dpi->modifiers);
3666 hold_modifiers = dpi->modifiers;
3669 dpi->modifiers = &adpm[0];
3672 adpm[0].templates = dpi->templates;
3685 d_print_error (dpi);
3690 adpm[i].next = dpi->modifiers;
3691 dpi->modifiers = &adpm[i];
3699 d_print_comp (dpi, d_right (dc));
3701 dpi->modifiers = hold_modifiers;
3709 d_print_mod (dpi, adpm[i].mod);
3712 d_print_array_type (dpi, dc, dpi->modifiers);
3721 dpm.next = dpi->modifiers;
3722 dpi->modifiers = &dpm;
3725 dpm.templates = dpi->templates;
3727 d_print_comp (dpi, d_right (dc));
3733 d_append_char (dpi, ' ');
3734 d_print_comp (dpi, d_left (dc));
3735 d_append_string (dpi, "::*");
3738 dpi->modifiers = dpm.next;
3746 d_print_comp (dpi, d_left (dc));
3749 d_append_string (dpi, ", ");
3750 dpi, d_right (dc));
3758 d_append_string (dpi, "operator");
3761 d_append_char (dpi, ' ');
3762 d_append_buffer (dpi, dc->u.s_operator.op->name,
3768 d_append_string (dpi, "operator ");
3769 d_print_comp (dpi, dc->u.s_extended_operator.name);
3773 d_append_string (dpi, "operator ");
3774 d_print_cast (dpi, dc);
3779 d_print_expr_op (dpi, d_left (dc));
3782 d_append_char (dpi, '(');
3783 d_print_cast (dpi, d_left (dc));
3784 d_append_char (dpi, ')');
3789 d_append_string (dpi, "()");
3791 d_print_subexpr (dpi, d_right (dc));
3797 d_print_error (dpi);
3807 d_append_char (dpi, '(');
3809 d_print_subexpr (dpi, d_left (d_right (dc)));
3811 d_print_expr_op (dpi, d_left (dc));
3812 d_print_subexpr (dpi, d_right (d_right (dc)));
3817 d_append_char (dpi, ')');
3823 d_print_error (dpi);
3830 d_print_error (dpi);
3833 d_print_subexpr (dpi, d_left (d_right (dc)));
3834 d_print_expr_op (dpi, d_left (dc));
3835 d_print_subexpr (dpi, d_left (d_right (d_right (dc))));
3836 d_append_string (dpi, " : ");
3837 d_print_subexpr (dpi, d_right (d_right (d_right (dc))));
3843 d_print_error (dpi);
3867 d_append_char (dpi, '-');
3868 d_print_comp (dpi, d_right (dc));
3874 d_append_char (dpi, 'u');
3877 d_append_char (dpi, 'l');
3880 d_append_string (dpi, "ul");
3883 d_append_string (dpi, "ll");
3886 d_append_string (dpi, "ull");
3901 d_append_string (dpi, "false");
3904 d_append_string (dpi, "true");
3917 d_append_char (dpi, '(');
3918 d_print_comp (dpi, d_left (dc));
3919 d_append_char (dpi, ')');
3921 d_append_char (dpi, '-');
3923 d_append_char (dpi, '[');
3924 d_print_comp (dpi, d_right (dc));
3926 d_append_char (dpi, ']');
3931 d_append_string (dpi, "java resource ");
3932 d_print_comp (dpi, d_left (dc));
3936 d_print_comp (dpi, d_left (dc));
3937 d_print_comp (dpi, d_right (dc));
3941 d_append_char (dpi, dc->u.s_character.character);
3945 d_append_string (dpi, "decltype (");
3946 d_print_comp (dpi, d_left (dc));
3947 d_append_char (dpi, ')');
3952 struct demangle_component *a = d_find_pack (dpi, d_left (dc));
3959 dpi->pack_index = i;
3960 d_print_comp (dpi, dc);
3962 d_append_string (dpi, ", ");
3968 d_print_error (dpi);
3979 d_print_java_identifier (struct d_print_info *dpi, const char *name, int len)
4015 d_append_char (dpi, c);
4021 d_append_char (dpi, *p);
4029 d_print_mod_list (struct d_print_info *dpi,
4034 if (mods == NULL || d_print_saw_error (dpi))
4043 d_print_mod_list (dpi, mods->next, suffix);
4049 hold_dpt = dpi->templates;
4050 dpi->templates = mods->templates;
4054 d_print_function_type (dpi, mods->mod, mods->next);
4055 dpi->templates = hold_dpt;
4060 d_print_array_type (dpi, mods->mod, mods->next);
4061 dpi->templates = hold_dpt;
4074 hold_modifiers = dpi->modifiers;
4075 dpi->modifiers = NULL;
4076 d_print_comp (dpi, d_left (mods->mod));
4077 dpi->modifiers = hold_modifiers;
4079 if ((dpi->options & DMGL_JAVA) == 0)
4080 d_append_string (dpi, "::");
4082 d_append_char (dpi, '.');
4090 d_print_comp (dpi, dc);
4092 dpi->templates = hold_dpt;
4096 d_print_mod (dpi, mods->mod);
4098 dpi->templates = hold_dpt;
4100 d_print_mod_list (dpi, mods->next, suffix);
4106 d_print_mod (struct d_print_info *dpi,
4113 d_append_string (dpi, " restrict");
4117 d_append_string (dpi, " volatile");
4121 d_append_string (dpi, " const");
4124 d_append_char (dpi, ' ');
4125 d_print_comp (dpi, d_right (mod));
4129 if ((dpi->options & DMGL_JAVA) == 0)
4130 d_append_char (dpi, '*');
4133 d_append_char (dpi, '&');
4136 d_append_string (dpi, "&&");
4139 d_append_string (dpi, "complex ");
4142 d_append_string (dpi, "imaginary ");
4145 if (d_last_char (dpi) != '(')
4146 d_append_char (dpi, ' ');
4147 d_print_comp (dpi, d_left (mod));
4148 d_append_string (dpi, "::*");
4151 d_print_comp (dpi, d_left (mod));
4156 d_print_comp (dpi, mod);
4164 d_print_function_type (struct d_print_info *dpi,
4218 if (d_last_char (dpi) != '('
4219 && d_last_char (dpi) != '*')
4222 if (need_space && d_last_char (dpi) != ' ')
4223 d_append_char (dpi, ' ');
4224 d_append_char (dpi, '(');
4227 hold_modifiers = dpi->modifiers;
4228 dpi->modifiers = NULL;
4230 d_print_mod_list (dpi, mods, 0);
4233 d_append_char (dpi, ')');
4235 d_append_char (dpi, '(');
4238 d_print_comp (dpi, d_right (dc));
4240 d_append_char (dpi, ')');
4242 d_print_mod_list (dpi, mods, 1);
4244 dpi->modifiers = hold_modifiers;
4250 d_print_array_type (struct d_print_info *dpi,
4282 d_append_string (dpi, " (");
4284 d_print_mod_list (dpi, mods, 0);
4287 d_append_char (dpi, ')');
4291 d_append_char (dpi, ' ');
4293 d_append_char (dpi, '[');
4296 d_print_comp (dpi, d_left (dc));
4298 d_append_char (dpi, ']');
4304 d_print_expr_op (struct d_print_info *dpi,
4308 d_append_buffer (dpi, dc->u.s_operator.op->name,
4311 d_print_comp (dpi, dc);
4317 d_print_cast (struct d_print_info *dpi,
4321 d_print_comp (dpi, d_left (dc));
4332 hold_dpm = dpi->modifiers;
4333 dpi->modifiers = NULL;
4335 dpt.next = dpi->templates;
4336 dpi->templates = &dpt;
4339 d_print_comp (dpi, d_left (d_left (dc)));
4341 dpi->templates = dpt.next;
4343 if (d_last_char (dpi) == '<')
4344 d_append_char (dpi, ' ');
4345 d_append_char (dpi, '<');
4346 d_print_comp (dpi, d_right (d_left (dc)));
4349 if (d_last_char (dpi) == '>')
4350 d_append_char (dpi, ' ');
4351 d_append_char (dpi, '>');
4353 dpi->modifiers = hold_dpm;