Lines Matching defs:work
61 #define CURRENT_DEMANGLING_STYLE work->options
144 #define PRINT_ANSI_QUALIFIERS (work -> options & DMGL_ANSI)
145 #define PRINT_ARG_TYPES (work -> options & DMGL_PARAMS)
322 #define SCOPE_STRING(work) ((work->options & DMGL_JAVA) ? "." : "::")
348 demangle_template_template_parm (struct work_stuff *work,
352 demangle_template (struct work_stuff *work, const char **, string *,
640 struct work_stuff work[1];
646 memset ((char *) work, 0, sizeof (work));
647 work->options = options;
655 if (do_type (work, &tem, &type))
749 if (do_type (work, &tem, &type))
757 squangle_mop_up (work);
849 struct work_stuff work[1];
854 memset ((char *) work, 0, sizeof (work));
855 work->options = options;
856 if ((work->options & DMGL_STYLE_MASK) == 0)
857 work->options |= (int) current_demangling_style & DMGL_STYLE_MASK;
862 ret = cplus_demangle_v3 (mangled, work->options);
877 ret = internal_cplus_demangle (work, mangled);
878 squangle_mop_up (work);
1011 internal_cplus_demangle (struct work_stuff *work, const char *mangled)
1018 s1 = work->constructor;
1019 s2 = work->destructor;
1020 s3 = work->static_type;
1021 s4 = work->type_quals;
1022 work->constructor = work->destructor = 0;
1023 work->type_quals = TYPE_UNQUALIFIED;
1024 work->dllimported = 0;
1039 success = gnu_special (work, &mangled, &decl);
1043 success = demangle_prefix (work, &mangled, &decl);
1047 success = demangle_signature (work, &mangled, &decl);
1049 if (work->constructor == 2)
1052 work->constructor = 0;
1054 else if (work->destructor == 2)
1057 work->destructor = 0;
1059 else if (work->dllimported == 1)
1062 work->dllimported = 0;
1064 demangled = mop_up (work, &decl, success);
1066 work->constructor = s1;
1067 work->destructor = s2;
1068 work->static_type = s3;
1069 work->type_quals = s4;
1076 squangle_mop_up (struct work_stuff *work)
1079 forget_B_and_K_types (work);
1080 if (work -> btypevec != NULL)
1082 free ((char *) work -> btypevec);
1084 if (work -> ktypevec != NULL)
1086 free ((char *) work -> ktypevec);
1091 /* Copy the work state and storage. */
1160 delete_non_B_K_work_stuff (struct work_stuff *work)
1164 forget_types (work);
1165 if (work -> typevec != NULL)
1167 free ((char *) work -> typevec);
1168 work -> typevec = NULL;
1169 work -> typevec_size = 0;
1171 if (work->tmpl_argvec)
1175 for (i = 0; i < work->ntmpl_args; i++)
1176 if (work->tmpl_argvec[i])
1177 free ((char*) work->tmpl_argvec[i]);
1179 free ((char*) work->tmpl_argvec);
1180 work->tmpl_argvec = NULL;
1182 if (work->previous_argument)
1184 string_delete (work->previous_argument);
1185 free ((char*) work->previous_argument);
1186 work->previous_argument = NULL;
1193 delete_work_stuff (struct work_stuff *work)
1195 delete_non_B_K_work_stuff (work);
1196 squangle_mop_up (work);
1203 mop_up (struct work_stuff *work, string *declp, int success)
1207 delete_non_B_K_work_stuff (work);
1233 demangle_signature (struct work_stuff *work, const char **mangled,
1255 demangle_signature (struct work_stuff *work,
1272 success = demangle_qualified (work, mangled, declp, 1, 0);
1274 remember_type (work, oldmangled, *mangled - oldmangled);
1282 success = demangle_qualified (work, mangled, declp, 1, 0);
1297 work -> static_type = 1;
1303 work->type_quals |= code_for_qualifier (**mangled);
1332 work->temp_start = -1; /* uppermost call to demangle_class */
1333 success = demangle_class (work, mangled, declp);
1336 remember_type (work, oldmangled, *mangled - oldmangled);
1351 success = do_type (work, mangled, &s);
1354 string_append (&s, SCOPE_STRING (work));
1381 forget_types (work);
1383 success = demangle_args (work, mangled, declp);
1391 success = do_type (work, mangled, &tname);
1405 success = demangle_template (work, mangled, &tname,
1409 remember_type (work, oldmangled, *mangled - oldmangled);
1411 string_append (&tname, SCOPE_STRING (work));
1414 if (work -> destructor & 1)
1418 work->destructor -= 1;
1420 if ((work->constructor & 1) || (work->destructor & 1))
1423 work->constructor -= 1;
1438 success = do_type (work, mangled, &return_type);
1468 success = demangle_template (work, mangled, declp, 0, 0,
1470 if (!(work->constructor & 1))
1485 success = demangle_args (work, mangled, declp);
1506 forget_types (work);
1508 success = demangle_args (work, mangled, declp);
1526 success = demangle_args (work, mangled, declp);
1531 if (work->static_type)
1533 if (work->type_quals != TYPE_UNQUALIFIED)
1536 string_append (declp, qualifier_string (work->type_quals));
1546 demangle_method_args (struct work_stuff *work, const char **mangled,
1551 if (work -> static_type)
1559 success = demangle_args (work, mangled, declp);
1567 demangle_template_template_parm (struct work_stuff *work,
1598 demangle_template_template_parm (work, mangled, tname);
1607 success = do_type (work, mangled, &temp);
1629 demangle_expression (struct work_stuff *work, const char **mangled,
1671 success = demangle_template_value_parm (work, mangled, s, tk);
1686 demangle_integral_value (struct work_stuff *work,
1692 success = demangle_expression (work, mangled, s, tk_integral);
1694 success = demangle_qualified (work, mangled, s, 0, 1);
1782 demangle_real_value (struct work_stuff *work,
1786 return demangle_expression (work, mangled, s, tk_real);
1823 demangle_template_value_parm (struct work_stuff *work, const char **mangled,
1836 || (work->tmpl_argvec && idx >= work->ntmpl_args)
1839 if (work->tmpl_argvec)
1840 string_append (s, work->tmpl_argvec[idx]);
1845 success = demangle_integral_value (work, mangled, s);
1878 success = demangle_real_value (work, mangled, s);
1882 success = demangle_qualified (work, mangled, s,
1902 q = cplus_demangle (p, work->options);
1932 demangle_template (struct work_stuff *work, const char **mangled,
1955 || (work->tmpl_argvec && idx >= work->ntmpl_args)
1959 if (work->tmpl_argvec)
1961 string_append (tname, work->tmpl_argvec[idx]);
1963 string_append (trawname, work->tmpl_argvec[idx]);
1979 is_java_array = (work -> options & DMGL_JAVA)
2000 work->tmpl_argvec = XNEWVEC (char *, r);
2001 work->ntmpl_args = r;
2003 work->tmpl_argvec[i] = 0;
2016 success = do_type (work, mangled, &temp);
2025 work->tmpl_argvec[i] = XNEWVEC (char, len + 1);
2026 memcpy (work->tmpl_argvec[i], temp.b, len);
2027 work->tmpl_argvec[i][len] = '\0';
2041 success = demangle_template_template_parm (work, mangled, tname);
2053 work->tmpl_argvec[i] = XNEWVEC (char, len + 1);
2054 memcpy (work->tmpl_argvec[i], *mangled, len);
2055 work->tmpl_argvec[i][len] = '\0';
2072 success = do_type (work, mangled, &temp);
2085 success = demangle_template_value_parm (work, mangled, s,
2099 work->tmpl_argvec[i] = XNEWVEC (char, len + 1);
2100 memcpy (work->tmpl_argvec[i], s->b, len);
2101 work->tmpl_argvec[i][len] = '\0';
2122 const int bindex = register_Btype (work);
2123 remember_Btype (work, tname->b, LEN_STRING (tname), bindex);
2127 if (work -> static_type)
2135 success = demangle_args (work, mangled, declp);
2143 arm_pt (struct work_stuff *work, const char *mangled,
2197 demangle_arm_hp_template (struct work_stuff *work, const char **mangled,
2221 if (work->temp_start == -1) /* non-recursive call */
2222 work->temp_start = declp->p - declp->b;
2226 hold_options = work->options;
2227 work->options |= DMGL_PARAMS;
2238 if (!do_type (work, mangled, &arg))
2245 if (!do_hpacc_template_const_value (work, mangled, &arg))
2251 if (!do_hpacc_template_literal (work, mangled, &arg))
2275 work->options = hold_options;
2279 else if (arm_pt (work, *mangled, n, &p, &args))
2286 if (work->temp_start == -1) /* non-recursive call */
2287 work->temp_start = declp->p - declp->b;
2291 hold_options = work->options;
2292 work->options |= DMGL_PARAMS;
2308 if (!do_type (work, &args, &type_str))
2332 if (!do_type (work, &args, &arg))
2338 work->options = hold_options;
2351 work->options = hold_options;
2363 if (work->temp_start == -1) /* non-recursive call only */
2364 work->temp_start = 0; /* disable in recursive calls */
2375 demangle_class_name (struct work_stuff *work, const char **mangled,
2386 demangle_arm_hp_template (work, mangled, n, declp);
2402 demangle_class (struct work_stuff *work, const char **mangled,
2429 demangle_class (struct work_stuff *work, const char **mangled, string *declp)
2437 btype = register_Btype (work);
2438 if (demangle_class_name (work, mangled, &class_name))
2441 if ((work->constructor & 1) || (work->destructor & 1))
2444 if (work->temp_start && (work->temp_start != -1))
2446 class_name.p = class_name.b + work->temp_start;
2449 if (work -> destructor & 1)
2452 work -> destructor -= 1;
2456 work -> constructor -= 1;
2460 remember_Ktype (work, class_name.b, LEN_STRING(&class_name));
2461 remember_Btype (work, class_name.b, LEN_STRING(&class_name), btype);
2462 string_prepend (declp, SCOPE_STRING (work));
2481 iterate_demangle_function (struct work_stuff *work, const char **mangled,
2497 demangle_function_name (work, mangled, declp, scan);
2506 work_stuff_copy_to_from (&work_init, work);
2516 demangle_function_name (work, mangled, declp, scan);
2517 success = demangle_signature (work, mangled, declp);
2525 work_stuff_copy_to_from (work, &work_init);
2556 demangle_prefix (struct work_stuff *work, const char **mangled,
2581 demangle_prefix (struct work_stuff *work, const char **mangled,
2596 work->dllimported = 1;
2607 work->destructor = 2;
2608 if (gnu_special (work, mangled, declp))
2615 work->constructor = 2;
2616 if (gnu_special (work, mangled, declp))
2625 work->destructor = 2;
2631 work->constructor = 2;
2663 else if (work -> static_type)
2693 work -> constructor += 1;
2703 demangle_arm_hp_template (work, mangled, strlen (*mangled), declp);
2713 demangle_arm_hp_template (work, mangled, strlen (*mangled), declp);
2735 return iterate_demangle_function (work, mangled, declp, scan);
2744 return iterate_demangle_function (work, mangled, declp, scan);
2752 if (!success && (work->constructor == 2 || work->destructor == 2))
2770 gnu_special (struct work_stuff *work, const char **mangled,
2790 gnu_special (struct work_stuff *work, const char **mangled, string *declp)
2802 work -> destructor += 1;
2815 input string, which means that demangle_signature has no work
2827 success = demangle_qualified (work, mangled, declp, 0, 1);
2830 success = demangle_template (work, mangled, declp, 0, 1,
2860 string_append (declp, SCOPE_STRING (work));
2883 success = demangle_qualified (work, mangled, declp, 0, 1);
2886 success = demangle_template (work, mangled, declp, 0, 1, 1);
2922 string_append (declp, SCOPE_STRING (work));
2942 char *method = internal_cplus_demangle (work, ++*mangled);
2969 success = demangle_qualified (work, mangled, declp, 0, 1);
2972 success = demangle_template (work, mangled, declp, 0, 1, 1);
2975 success = do_type (work, mangled, declp);
2991 recursively_demangle(struct work_stuff *work, const char **mangled,
3001 recurse_dem = cplus_demangle (recurse, work->options);
3050 input string, which means that demangle_signature has no work
3123 demangle_qualified (struct work_stuff *work, const char **mangled,
3131 int bindex = register_Btype (work);
3136 && ((work->constructor & 1) || (work->destructor & 1)));
3147 if (idx == -1 || idx >= work -> numk)
3150 string_append (&temp, work -> ktypevec[idx]);
3216 success = demangle_template(work, mangled, &temp,
3226 if (idx == -1 || idx >= work->numk)
3229 string_append (&temp, work->ktypevec[idx]);
3248 recursively_demangle(work, mangled, &temp, namelength);
3253 success = do_type (work, mangled, &last_name);
3261 remember_Ktype (work, temp.b, LEN_STRING (&temp));
3264 string_append (&temp, SCOPE_STRING (work));
3267 remember_Btype (work, temp.b, LEN_STRING (&temp), bindex);
3276 string_append (&temp, SCOPE_STRING (work));
3277 if (work -> destructor & 1)
3290 string_append (&temp, SCOPE_STRING (work));
3382 do_type (struct work_stuff *work, const char **mangled, string *result)
3407 if (! (work -> options & DMGL_JAVA))
3433 success = demangle_template_value_parm (work, mangled, &decl,
3444 if (!get_count (mangled, &n) || n >= work -> ntypes)
3450 remembered_type = work -> typevec[n];
3467 if (!demangle_nested_args (work, mangled, &decl)
3490 string_prepend (&decl, SCOPE_STRING (work));
3507 do_type (work, mangled, &temp);
3515 success = demangle_template (work, mangled, &temp,
3527 success = demangle_qualified (work, mangled, &decl,
3561 if ((member && !demangle_nested_args (work, mangled, &decl))
3612 success = demangle_qualified (work, mangled, result, 0, 1);
3619 if (!get_count (mangled, &n) || n >= work -> numb)
3622 string_append (result, work->btypevec[n]);
3635 || (work->tmpl_argvec && idx >= work->ntmpl_args)
3642 if (work->tmpl_argvec)
3643 string_append (result, work->tmpl_argvec[idx]);
3652 success = demangle_fund_type (work, mangled, result);
3691 demangle_fund_type (struct work_stuff *work,
3856 int bindex = register_Btype (work);
3859 if (demangle_class_name (work, mangled, &btype)) {
3860 remember_Btype (work, btype.b, LEN_STRING (&btype), bindex);
3873 success = demangle_template (work, mangled, &btype, 0, 1, 1);
3891 do_hpacc_template_const_value (struct work_stuff *work ATTRIBUTE_UNUSED,
3946 do_hpacc_template_literal (struct work_stuff *work, const char **mangled,
3972 recurse_dem = cplus_demangle (recurse, work->options);
4019 do_arg (struct work_stuff *work, const char **mangled, string *result)
4027 if (work->nrepeats > 0)
4029 --work->nrepeats;
4031 if (work->previous_argument == 0)
4035 string_appends (result, work->previous_argument);
4043 work->nrepeats = consume_count(mangled);
4045 if (work->nrepeats <= 0)
4049 if (work->nrepeats > 9)
4060 return do_arg (work, mangled, result);
4067 if (work->previous_argument)
4068 string_delete (work->previous_argument);
4070 work->previous_argument = XNEW (string);
4072 if (!do_type (work, mangled, work->previous_argument))
4075 string_appends (result, work->previous_argument);
4077 remember_type (work, start, *mangled - start);
4082 remember_type (struct work_stuff *work, const char *start, int len)
4086 if (work->forgetting_types)
4089 if (work -> ntypes >= work -> typevec_size)
4091 if (work -> typevec_size == 0)
4093 work -> typevec_size = 3;
4094 work -> typevec = XNEWVEC (char *, work->typevec_size);
4098 work -> typevec_size *= 2;
4099 work -> typevec
4100 = XRESIZEVEC (char *, work->typevec, work->typevec_size);
4106 work -> typevec[work -> ntypes++] = tem;
4112 remember_Ktype (struct work_stuff *work, const char *start, int len)
4116 if (work -> numk >= work -> ksize)
4118 if (work -> ksize == 0)
4120 work -> ksize = 5;
4121 work -> ktypevec = XNEWVEC (char *, work->ksize);
4125 work -> ksize *= 2;
4126 work -> ktypevec
4127 = XRESIZEVEC (char *, work->ktypevec, work->ksize);
4133 work -> ktypevec[work -> numk++] = tem;
4141 register_Btype (struct work_stuff *work)
4145 if (work -> numb >= work -> bsize)
4147 if (work -> bsize == 0)
4149 work -> bsize = 5;
4150 work -> btypevec = XNEWVEC (char *, work->bsize);
4154 work -> bsize *= 2;
4155 work -> btypevec
4156 = XRESIZEVEC (char *, work->btypevec, work->bsize);
4159 ret = work -> numb++;
4160 work -> btypevec[ret] = NULL;
4167 remember_Btype (struct work_stuff *work, const char *start,
4175 work -> btypevec[index] = tem;
4180 forget_B_and_K_types (struct work_stuff *work)
4184 while (work -> numk > 0)
4186 i = --(work -> numk);
4187 if (work -> ktypevec[i] != NULL)
4189 free (work -> ktypevec[i]);
4190 work -> ktypevec[i] = NULL;
4194 while (work -> numb > 0)
4196 i = --(work -> numb);
4197 if (work -> btypevec[i] != NULL)
4199 free (work -> btypevec[i]);
4200 work -> btypevec[i] = NULL;
4207 forget_types (struct work_stuff *work)
4211 while (work -> ntypes > 0)
4213 i = --(work -> ntypes);
4214 if (work -> typevec[i] != NULL)
4216 free (work -> typevec[i]);
4217 work -> typevec[i] = NULL;
4265 demangle_args (struct work_stuff *work, const char **mangled,
4285 || work->nrepeats > 0)
4302 if ((HP_DEMANGLING || ARM_DEMANGLING || EDG_DEMANGLING) && work -> ntypes >= 10)
4328 if ((t < 0) || (t >= work -> ntypes))
4332 while (work->nrepeats > 0 || --r >= 0)
4334 tem = work -> typevec[t];
4339 if (!do_arg (work, &tem, &arg))
4355 if (!do_arg (work, mangled, &arg))
4388 demangle_nested_args (struct work_stuff *work, const char **mangled,
4399 ++work->forgetting_types;
4403 saved_previous_argument = work->previous_argument;
4404 saved_nrepeats = work->nrepeats;
4405 work->previous_argument = 0;
4406 work->nrepeats = 0;
4409 result = demangle_args (work, mangled, declp);
4412 if (work->previous_argument)
4414 string_delete (work->previous_argument);
4415 free ((char *) work->previous_argument);
4417 work->previous_argument = saved_previous_argument;
4418 --work->forgetting_types;
4419 work->nrepeats = saved_nrepeats;
4425 demangle_function_name (struct work_stuff *work, const char **mangled,
4448 demangle_arm_hp_template (work, mangled, 0, declp);
4462 work -> constructor += 1;
4468 work -> destructor += 1;
4518 if (do_type (work, &tem, &type))
4532 if (do_type (work, &tem, &type))