• Home
  • Raw
  • Download

Lines Matching refs:di

764 d_make_empty (struct d_info *di)  in d_make_empty()  argument
768 if (di->next_comp >= di->num_comps) in d_make_empty()
770 p = &di->comps[di->next_comp]; in d_make_empty()
771 ++di->next_comp; in d_make_empty()
778 d_make_comp (struct d_info *di, enum demangle_component_type type, in d_make_comp() argument
865 p = d_make_empty (di); in d_make_comp()
878 d_make_demangle_mangled_name (struct d_info *di, const char *s) in d_make_demangle_mangled_name() argument
880 if (d_peek_char (di) != '_' || d_peek_next_char (di) != 'Z') in d_make_demangle_mangled_name()
881 return d_make_name (di, s, strlen (s)); in d_make_demangle_mangled_name()
882 d_advance (di, 2); in d_make_demangle_mangled_name()
883 return d_encoding (di, 0); in d_make_demangle_mangled_name()
889 d_make_name (struct d_info *di, const char *s, int len) in d_make_name() argument
893 p = d_make_empty (di); in d_make_name()
902 d_make_builtin_type (struct d_info *di, in d_make_builtin_type() argument
909 p = d_make_empty (di); in d_make_builtin_type()
921 d_make_operator (struct d_info *di, const struct demangle_operator_info *op) in d_make_operator() argument
925 p = d_make_empty (di); in d_make_operator()
937 d_make_extended_operator (struct d_info *di, int args, in d_make_extended_operator() argument
942 p = d_make_empty (di); in d_make_extended_operator()
949 d_make_default_arg (struct d_info *di, int num, in d_make_default_arg() argument
952 struct demangle_component *p = d_make_empty (di); in d_make_default_arg()
965 d_make_ctor (struct d_info *di, enum gnu_v3_ctor_kinds kind, in d_make_ctor() argument
970 p = d_make_empty (di); in d_make_ctor()
979 d_make_dtor (struct d_info *di, enum gnu_v3_dtor_kinds kind, in d_make_dtor() argument
984 p = d_make_empty (di); in d_make_dtor()
993 d_make_template_param (struct d_info *di, long i) in d_make_template_param() argument
997 p = d_make_empty (di); in d_make_template_param()
1009 d_make_function_param (struct d_info *di, long i) in d_make_function_param() argument
1013 p = d_make_empty (di); in d_make_function_param()
1025 d_make_sub (struct d_info *di, const char *name, int len) in d_make_sub() argument
1029 p = d_make_empty (di); in d_make_sub()
1045 cplus_demangle_mangled_name (struct d_info *di, int top_level) in cplus_demangle_mangled_name() argument
1047 if (! d_check_char (di, '_') in cplus_demangle_mangled_name()
1053 if (! d_check_char (di, 'Z')) in cplus_demangle_mangled_name()
1055 return d_encoding (di, top_level); in cplus_demangle_mangled_name()
1117 d_encoding (struct d_info *di, int top_level) in d_encoding() argument
1119 char peek = d_peek_char (di); in d_encoding()
1122 return d_special_name (di); in d_encoding()
1127 dc = d_name (di); in d_encoding()
1129 if (dc != NULL && top_level && (di->options & DMGL_PARAMS) == 0) in d_encoding()
1158 peek = d_peek_char (di); in d_encoding()
1161 return d_make_comp (di, DEMANGLE_COMPONENT_TYPED_NAME, dc, in d_encoding()
1162 d_bare_function_type (di, has_return_type (dc))); in d_encoding()
1179 d_name (struct d_info *di) in d_name() argument
1181 char peek = d_peek_char (di); in d_name()
1187 return d_nested_name (di); in d_name()
1190 return d_local_name (di); in d_name()
1194 return d_unqualified_name (di); in d_name()
1200 if (d_peek_next_char (di) != 't') in d_name()
1202 dc = d_substitution (di, 0); in d_name()
1207 d_advance (di, 2); in d_name()
1208 dc = d_make_comp (di, DEMANGLE_COMPONENT_QUAL_NAME, in d_name()
1209 d_make_name (di, "std", 3), in d_name()
1210 d_unqualified_name (di)); in d_name()
1211 di->expansion += 3; in d_name()
1215 if (d_peek_char (di) != 'I') in d_name()
1229 if (! d_add_substitution (di, dc)) in d_name()
1232 dc = d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE, dc, in d_name()
1233 d_template_args (di)); in d_name()
1240 dc = d_unqualified_name (di); in d_name()
1241 if (d_peek_char (di) == 'I') in d_name()
1246 if (! d_add_substitution (di, dc)) in d_name()
1248 dc = d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE, dc, in d_name()
1249 d_template_args (di)); in d_name()
1260 d_nested_name (struct d_info *di) in d_nested_name() argument
1265 if (! d_check_char (di, 'N')) in d_nested_name()
1268 pret = d_cv_qualifiers (di, &ret, 1); in d_nested_name()
1272 *pret = d_prefix (di); in d_nested_name()
1276 if (! d_check_char (di, 'E')) in d_nested_name()
1294 d_prefix (struct d_info *di) in d_prefix() argument
1304 peek = d_peek_char (di); in d_prefix()
1319 dc = d_unqualified_name (di); in d_prefix()
1321 dc = d_substitution (di, 1); in d_prefix()
1327 dc = d_template_args (di); in d_prefix()
1330 dc = d_template_param (di); in d_prefix()
1340 d_advance (di, 1); in d_prefix()
1349 ret = d_make_comp (di, comb_type, ret, dc); in d_prefix()
1351 if (peek != 'S' && d_peek_char (di) != 'E') in d_prefix()
1353 if (! d_add_substitution (di, ret)) in d_prefix()
1368 d_unqualified_name (struct d_info *di) in d_unqualified_name() argument
1372 peek = d_peek_char (di); in d_unqualified_name()
1374 return d_source_name (di); in d_unqualified_name()
1379 ret = d_operator_name (di); in d_unqualified_name()
1381 di->expansion += sizeof "operator" + ret->u.s_operator.op->len - 2; in d_unqualified_name()
1385 return d_ctor_dtor_name (di); in d_unqualified_name()
1390 d_advance (di, 1); in d_unqualified_name()
1392 ret = d_source_name (di); in d_unqualified_name()
1395 if (! d_discriminator (di)) in d_unqualified_name()
1401 switch (d_peek_next_char (di)) in d_unqualified_name()
1404 return d_lambda (di); in d_unqualified_name()
1406 return d_unnamed_type (di); in d_unqualified_name()
1418 d_source_name (struct d_info *di) in d_source_name() argument
1423 len = d_number (di); in d_source_name()
1426 ret = d_identifier (di, len); in d_source_name()
1427 di->last_name = ret; in d_source_name()
1434 d_number (struct d_info *di) in d_number() argument
1441 peek = d_peek_char (di); in d_number()
1445 d_advance (di, 1); in d_number()
1446 peek = d_peek_char (di); in d_number()
1459 d_advance (di, 1); in d_number()
1460 peek = d_peek_char (di); in d_number()
1467 d_number_component (struct d_info *di) in d_number_component() argument
1469 struct demangle_component *ret = d_make_empty (di); in d_number_component()
1473 ret->u.s_number.number = d_number (di); in d_number_component()
1481 d_identifier (struct d_info *di, int len) in d_identifier() argument
1485 name = d_str (di); in d_identifier()
1487 if (di->send - name < len) in d_identifier()
1490 d_advance (di, len); in d_identifier()
1495 if ((di->options & DMGL_JAVA) != 0 in d_identifier()
1496 && d_peek_char (di) == '$') in d_identifier()
1497 d_advance (di, 1); in d_identifier()
1512 di->expansion -= len - sizeof "(anonymous namespace)"; in d_identifier()
1513 return d_make_name (di, "(anonymous namespace)", in d_identifier()
1518 return d_make_name (di, name, len); in d_identifier()
1587 d_operator_name (struct d_info *di) in d_operator_name() argument
1592 c1 = d_next_char (di); in d_operator_name()
1593 c2 = d_next_char (di); in d_operator_name()
1595 return d_make_extended_operator (di, c2 - '0', d_source_name (di)); in d_operator_name()
1597 return d_make_comp (di, DEMANGLE_COMPONENT_CAST, in d_operator_name()
1598 cplus_demangle_type (di), NULL); in d_operator_name()
1618 return d_make_operator (di, p); in d_operator_name()
1631 d_make_character (struct d_info *di, int c) in d_make_character() argument
1634 p = d_make_empty (di); in d_make_character()
1644 d_java_resource (struct d_info *di) in d_java_resource() argument
1652 len = d_number (di); in d_java_resource()
1657 if (d_next_char (di) != '_') in d_java_resource()
1661 str = d_str (di); in d_java_resource()
1688 next = d_make_character (di, c); in d_java_resource()
1689 d_advance (di, i); in d_java_resource()
1690 str = d_str (di); in d_java_resource()
1702 next = d_make_name (di, str, i); in d_java_resource()
1703 d_advance (di, i); in d_java_resource()
1704 str = d_str (di); in d_java_resource()
1715 p = d_make_comp (di, DEMANGLE_COMPONENT_COMPOUND_NAME, p, next); in d_java_resource()
1721 p = d_make_comp (di, DEMANGLE_COMPONENT_JAVA_RESOURCE, p, NULL); in d_java_resource()
1743 d_special_name (struct d_info *di) in d_special_name() argument
1745 di->expansion += 20; in d_special_name()
1746 if (d_check_char (di, 'T')) in d_special_name()
1748 switch (d_next_char (di)) in d_special_name()
1751 di->expansion -= 5; in d_special_name()
1752 return d_make_comp (di, DEMANGLE_COMPONENT_VTABLE, in d_special_name()
1753 cplus_demangle_type (di), NULL); in d_special_name()
1755 di->expansion -= 10; in d_special_name()
1756 return d_make_comp (di, DEMANGLE_COMPONENT_VTT, in d_special_name()
1757 cplus_demangle_type (di), NULL); in d_special_name()
1759 return d_make_comp (di, DEMANGLE_COMPONENT_TYPEINFO, in d_special_name()
1760 cplus_demangle_type (di), NULL); in d_special_name()
1762 return d_make_comp (di, DEMANGLE_COMPONENT_TYPEINFO_NAME, in d_special_name()
1763 cplus_demangle_type (di), NULL); in d_special_name()
1766 if (! d_call_offset (di, 'h')) in d_special_name()
1768 return d_make_comp (di, DEMANGLE_COMPONENT_THUNK, in d_special_name()
1769 d_encoding (di, 0), NULL); in d_special_name()
1772 if (! d_call_offset (di, 'v')) in d_special_name()
1774 return d_make_comp (di, DEMANGLE_COMPONENT_VIRTUAL_THUNK, in d_special_name()
1775 d_encoding (di, 0), NULL); in d_special_name()
1778 if (! d_call_offset (di, '\0')) in d_special_name()
1780 if (! d_call_offset (di, '\0')) in d_special_name()
1782 return d_make_comp (di, DEMANGLE_COMPONENT_COVARIANT_THUNK, in d_special_name()
1783 d_encoding (di, 0), NULL); in d_special_name()
1791 derived_type = cplus_demangle_type (di); in d_special_name()
1792 offset = d_number (di); in d_special_name()
1795 if (! d_check_char (di, '_')) in d_special_name()
1797 base_type = cplus_demangle_type (di); in d_special_name()
1800 di->expansion += 5; in d_special_name()
1801 return d_make_comp (di, DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE, in d_special_name()
1806 return d_make_comp (di, DEMANGLE_COMPONENT_TYPEINFO_FN, in d_special_name()
1807 cplus_demangle_type (di), NULL); in d_special_name()
1809 return d_make_comp (di, DEMANGLE_COMPONENT_JAVA_CLASS, in d_special_name()
1810 cplus_demangle_type (di), NULL); in d_special_name()
1816 else if (d_check_char (di, 'G')) in d_special_name()
1818 switch (d_next_char (di)) in d_special_name()
1821 return d_make_comp (di, DEMANGLE_COMPONENT_GUARD, d_name (di), NULL); in d_special_name()
1824 return d_make_comp (di, DEMANGLE_COMPONENT_REFTEMP, d_name (di), in d_special_name()
1828 return d_make_comp (di, DEMANGLE_COMPONENT_HIDDEN_ALIAS, in d_special_name()
1829 d_encoding (di, 0), NULL); in d_special_name()
1832 return d_java_resource (di); in d_special_name()
1856 d_call_offset (struct d_info *di, int c) in d_call_offset() argument
1859 c = d_next_char (di); in d_call_offset()
1862 d_number (di); in d_call_offset()
1865 d_number (di); in d_call_offset()
1866 if (! d_check_char (di, '_')) in d_call_offset()
1868 d_number (di); in d_call_offset()
1873 if (! d_check_char (di, '_')) in d_call_offset()
1888 d_ctor_dtor_name (struct d_info *di) in d_ctor_dtor_name() argument
1890 if (di->last_name != NULL) in d_ctor_dtor_name()
1892 if (di->last_name->type == DEMANGLE_COMPONENT_NAME) in d_ctor_dtor_name()
1893 di->expansion += di->last_name->u.s_name.len; in d_ctor_dtor_name()
1894 else if (di->last_name->type == DEMANGLE_COMPONENT_SUB_STD) in d_ctor_dtor_name()
1895 di->expansion += di->last_name->u.s_string.len; in d_ctor_dtor_name()
1897 switch (d_peek_char (di)) in d_ctor_dtor_name()
1903 switch (d_peek_next_char (di)) in d_ctor_dtor_name()
1917 d_advance (di, 2); in d_ctor_dtor_name()
1918 return d_make_ctor (di, kind, di->last_name); in d_ctor_dtor_name()
1925 switch (d_peek_next_char (di)) in d_ctor_dtor_name()
1939 d_advance (di, 2); in d_ctor_dtor_name()
1940 return d_make_dtor (di, kind, di->last_name); in d_ctor_dtor_name()
2012 cplus_demangle_type (struct d_info *di) in cplus_demangle_type() argument
2033 peek = d_peek_char (di); in cplus_demangle_type()
2038 pret = d_cv_qualifiers (di, &ret, 0); in cplus_demangle_type()
2041 *pret = cplus_demangle_type (di); in cplus_demangle_type()
2042 if (! *pret || ! d_add_substitution (di, ret)) in cplus_demangle_type()
2055 ret = d_make_builtin_type (di, in cplus_demangle_type()
2057 di->expansion += ret->u.s_builtin.type->len; in cplus_demangle_type()
2059 d_advance (di, 1); in cplus_demangle_type()
2063 d_advance (di, 1); in cplus_demangle_type()
2064 ret = d_make_comp (di, DEMANGLE_COMPONENT_VENDOR_TYPE, in cplus_demangle_type()
2065 d_source_name (di), NULL); in cplus_demangle_type()
2069 ret = d_function_type (di); in cplus_demangle_type()
2076 ret = d_class_enum_type (di); in cplus_demangle_type()
2080 ret = d_array_type (di); in cplus_demangle_type()
2084 ret = d_pointer_to_member_type (di); in cplus_demangle_type()
2088 ret = d_template_param (di); in cplus_demangle_type()
2089 if (d_peek_char (di) == 'I') in cplus_demangle_type()
2094 if (! d_add_substitution (di, ret)) in cplus_demangle_type()
2096 ret = d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE, ret, in cplus_demangle_type()
2097 d_template_args (di)); in cplus_demangle_type()
2107 peek_next = d_peek_next_char (di); in cplus_demangle_type()
2112 ret = d_substitution (di, 0); in cplus_demangle_type()
2115 if (d_peek_char (di) == 'I') in cplus_demangle_type()
2116 ret = d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE, ret, in cplus_demangle_type()
2117 d_template_args (di)); in cplus_demangle_type()
2123 ret = d_class_enum_type (di); in cplus_demangle_type()
2135 d_advance (di, 1); in cplus_demangle_type()
2136 ret = d_make_comp (di, DEMANGLE_COMPONENT_RVALUE_REFERENCE, in cplus_demangle_type()
2137 cplus_demangle_type (di), NULL); in cplus_demangle_type()
2141 d_advance (di, 1); in cplus_demangle_type()
2142 ret = d_make_comp (di, DEMANGLE_COMPONENT_POINTER, in cplus_demangle_type()
2143 cplus_demangle_type (di), NULL); in cplus_demangle_type()
2147 d_advance (di, 1); in cplus_demangle_type()
2148 ret = d_make_comp (di, DEMANGLE_COMPONENT_REFERENCE, in cplus_demangle_type()
2149 cplus_demangle_type (di), NULL); in cplus_demangle_type()
2153 d_advance (di, 1); in cplus_demangle_type()
2154 ret = d_make_comp (di, DEMANGLE_COMPONENT_COMPLEX, in cplus_demangle_type()
2155 cplus_demangle_type (di), NULL); in cplus_demangle_type()
2159 d_advance (di, 1); in cplus_demangle_type()
2160 ret = d_make_comp (di, DEMANGLE_COMPONENT_IMAGINARY, in cplus_demangle_type()
2161 cplus_demangle_type (di), NULL); in cplus_demangle_type()
2165 d_advance (di, 1); in cplus_demangle_type()
2166 ret = d_source_name (di); in cplus_demangle_type()
2167 ret = d_make_comp (di, DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL, in cplus_demangle_type()
2168 cplus_demangle_type (di), ret); in cplus_demangle_type()
2173 d_advance (di, 1); in cplus_demangle_type()
2174 peek = d_next_char (di); in cplus_demangle_type()
2180 ret = d_make_comp (di, DEMANGLE_COMPONENT_DECLTYPE, in cplus_demangle_type()
2181 d_expression (di), NULL); in cplus_demangle_type()
2182 if (ret && d_next_char (di) != 'E') in cplus_demangle_type()
2188 ret = d_make_comp (di, DEMANGLE_COMPONENT_PACK_EXPANSION, in cplus_demangle_type()
2189 cplus_demangle_type (di), NULL); in cplus_demangle_type()
2194 ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[26]); in cplus_demangle_type()
2195 di->expansion += ret->u.s_builtin.type->len; in cplus_demangle_type()
2199 ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[27]); in cplus_demangle_type()
2200 di->expansion += ret->u.s_builtin.type->len; in cplus_demangle_type()
2204 ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[28]); in cplus_demangle_type()
2205 di->expansion += ret->u.s_builtin.type->len; in cplus_demangle_type()
2209 ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[29]); in cplus_demangle_type()
2210 di->expansion += ret->u.s_builtin.type->len; in cplus_demangle_type()
2214 ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[30]); in cplus_demangle_type()
2215 di->expansion += ret->u.s_builtin.type->len; in cplus_demangle_type()
2219 ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[31]); in cplus_demangle_type()
2220 di->expansion += ret->u.s_builtin.type->len; in cplus_demangle_type()
2225 ret = d_make_empty (di); in cplus_demangle_type()
2227 if ((ret->u.s_fixed.accum = IS_DIGIT (d_peek_char (di)))) in cplus_demangle_type()
2229 d_number (di); in cplus_demangle_type()
2230 ret->u.s_fixed.length = cplus_demangle_type (di); in cplus_demangle_type()
2233 d_number (di); in cplus_demangle_type()
2234 peek = d_next_char (di); in cplus_demangle_type()
2239 ret = d_vector_type (di); in cplus_demangle_type()
2244 ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[32]); in cplus_demangle_type()
2245 di->expansion += ret->u.s_builtin.type->len; in cplus_demangle_type()
2259 if (! d_add_substitution (di, ret)) in cplus_demangle_type()
2269 d_cv_qualifiers (struct d_info *di, in d_cv_qualifiers() argument
2274 peek = d_peek_char (di); in d_cv_qualifiers()
2279 d_advance (di, 1); in d_cv_qualifiers()
2285 di->expansion += sizeof "restrict"; in d_cv_qualifiers()
2292 di->expansion += sizeof "volatile"; in d_cv_qualifiers()
2299 di->expansion += sizeof "const"; in d_cv_qualifiers()
2302 *pret = d_make_comp (di, t, NULL, NULL); in d_cv_qualifiers()
2307 peek = d_peek_char (di); in d_cv_qualifiers()
2316 d_function_type (struct d_info *di) in d_function_type() argument
2320 if (! d_check_char (di, 'F')) in d_function_type()
2322 if (d_peek_char (di) == 'Y') in d_function_type()
2326 d_advance (di, 1); in d_function_type()
2328 ret = d_bare_function_type (di, 1); in d_function_type()
2329 if (! d_check_char (di, 'E')) in d_function_type()
2337 d_parmlist (struct d_info *di) in d_parmlist() argument
2348 char peek = d_peek_char (di); in d_parmlist()
2351 type = cplus_demangle_type (di); in d_parmlist()
2354 *ptl = d_make_comp (di, DEMANGLE_COMPONENT_ARGLIST, type, NULL); in d_parmlist()
2371 di->expansion -= d_left (tl)->u.s_builtin.type->len; in d_parmlist()
2381 d_bare_function_type (struct d_info *di, int has_return_type) in d_bare_function_type() argument
2389 peek = d_peek_char (di); in d_bare_function_type()
2392 d_advance (di, 1); in d_bare_function_type()
2398 return_type = cplus_demangle_type (di); in d_bare_function_type()
2405 tl = d_parmlist (di); in d_bare_function_type()
2409 return d_make_comp (di, DEMANGLE_COMPONENT_FUNCTION_TYPE, in d_bare_function_type()
2416 d_class_enum_type (struct d_info *di) in d_class_enum_type() argument
2418 return d_name (di); in d_class_enum_type()
2426 d_array_type (struct d_info *di) in d_array_type() argument
2431 if (! d_check_char (di, 'A')) in d_array_type()
2434 peek = d_peek_char (di); in d_array_type()
2441 s = d_str (di); in d_array_type()
2444 d_advance (di, 1); in d_array_type()
2445 peek = d_peek_char (di); in d_array_type()
2448 dim = d_make_name (di, s, d_str (di) - s); in d_array_type()
2454 dim = d_expression (di); in d_array_type()
2459 if (! d_check_char (di, '_')) in d_array_type()
2462 return d_make_comp (di, DEMANGLE_COMPONENT_ARRAY_TYPE, dim, in d_array_type()
2463 cplus_demangle_type (di)); in d_array_type()
2470 d_vector_type (struct d_info *di) in d_vector_type() argument
2475 peek = d_peek_char (di); in d_vector_type()
2478 d_advance (di, 1); in d_vector_type()
2479 dim = d_expression (di); in d_vector_type()
2482 dim = d_number_component (di); in d_vector_type()
2487 if (! d_check_char (di, '_')) in d_vector_type()
2490 return d_make_comp (di, DEMANGLE_COMPONENT_VECTOR_TYPE, dim, in d_vector_type()
2491 cplus_demangle_type (di)); in d_vector_type()
2497 d_pointer_to_member_type (struct d_info *di) in d_pointer_to_member_type() argument
2503 if (! d_check_char (di, 'M')) in d_pointer_to_member_type()
2506 cl = cplus_demangle_type (di); in d_pointer_to_member_type()
2524 pmem = d_cv_qualifiers (di, &mem, 1); in d_pointer_to_member_type()
2527 *pmem = cplus_demangle_type (di); in d_pointer_to_member_type()
2533 if (! d_add_substitution (di, mem)) in d_pointer_to_member_type()
2537 return d_make_comp (di, DEMANGLE_COMPONENT_PTRMEM_TYPE, cl, mem); in d_pointer_to_member_type()
2543 d_compact_number (struct d_info *di) in d_compact_number() argument
2546 if (d_peek_char (di) == '_') in d_compact_number()
2548 else if (d_peek_char (di) == 'n') in d_compact_number()
2551 num = d_number (di) + 1; in d_compact_number()
2553 if (! d_check_char (di, '_')) in d_compact_number()
2563 d_template_param (struct d_info *di) in d_template_param() argument
2567 if (! d_check_char (di, 'T')) in d_template_param()
2570 param = d_compact_number (di); in d_template_param()
2574 ++di->did_subs; in d_template_param()
2576 return d_make_template_param (di, param); in d_template_param()
2582 d_template_args (struct d_info *di) in d_template_args() argument
2591 hold_last_name = di->last_name; in d_template_args()
2593 if (! d_check_char (di, 'I')) in d_template_args()
2596 if (d_peek_char (di) == 'E') in d_template_args()
2599 d_advance (di, 1); in d_template_args()
2600 return d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE_ARGLIST, NULL, NULL); in d_template_args()
2609 a = d_template_arg (di); in d_template_args()
2613 *pal = d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE_ARGLIST, a, NULL); in d_template_args()
2618 if (d_peek_char (di) == 'E') in d_template_args()
2620 d_advance (di, 1); in d_template_args()
2625 di->last_name = hold_last_name; in d_template_args()
2636 d_template_arg (struct d_info *di) in d_template_arg() argument
2640 switch (d_peek_char (di)) in d_template_arg()
2643 d_advance (di, 1); in d_template_arg()
2644 ret = d_expression (di); in d_template_arg()
2645 if (! d_check_char (di, 'E')) in d_template_arg()
2650 return d_expr_primary (di); in d_template_arg()
2654 return d_template_args (di); in d_template_arg()
2657 return cplus_demangle_type (di); in d_template_arg()
2664 d_exprlist (struct d_info *di) in d_exprlist() argument
2669 if (d_peek_char (di) == 'E') in d_exprlist()
2671 d_advance (di, 1); in d_exprlist()
2672 return d_make_comp (di, DEMANGLE_COMPONENT_ARGLIST, NULL, NULL); in d_exprlist()
2677 struct demangle_component *arg = d_expression (di); in d_exprlist()
2681 *p = d_make_comp (di, DEMANGLE_COMPONENT_ARGLIST, arg, NULL); in d_exprlist()
2686 if (d_peek_char (di) == 'E') in d_exprlist()
2688 d_advance (di, 1); in d_exprlist()
2708 d_expression (struct d_info *di) in d_expression() argument
2712 peek = d_peek_char (di); in d_expression()
2714 return d_expr_primary (di); in d_expression()
2716 return d_template_param (di); in d_expression()
2717 else if (peek == 's' && d_peek_next_char (di) == 'r') in d_expression()
2722 d_advance (di, 2); in d_expression()
2723 type = cplus_demangle_type (di); in d_expression()
2724 name = d_unqualified_name (di); in d_expression()
2725 if (d_peek_char (di) != 'I') in d_expression()
2726 return d_make_comp (di, DEMANGLE_COMPONENT_QUAL_NAME, type, name); in d_expression()
2728 return d_make_comp (di, DEMANGLE_COMPONENT_QUAL_NAME, type, in d_expression()
2729 d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE, name, in d_expression()
2730 d_template_args (di))); in d_expression()
2732 else if (peek == 's' && d_peek_next_char (di) == 'p') in d_expression()
2734 d_advance (di, 2); in d_expression()
2735 return d_make_comp (di, DEMANGLE_COMPONENT_PACK_EXPANSION, in d_expression()
2736 d_expression (di), NULL); in d_expression()
2738 else if (peek == 'f' && d_peek_next_char (di) == 'p') in d_expression()
2742 d_advance (di, 2); in d_expression()
2743 index = d_compact_number (di); in d_expression()
2747 return d_make_function_param (di, index); in d_expression()
2750 || (peek == 'o' && d_peek_next_char (di) == 'n')) in d_expression()
2758 d_advance (di, 2); in d_expression()
2760 name = d_unqualified_name (di); in d_expression()
2763 if (d_peek_char (di) == 'I') in d_expression()
2764 return d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE, name, in d_expression()
2765 d_template_args (di)); in d_expression()
2774 op = d_operator_name (di); in d_expression()
2779 di->expansion += op->u.s_operator.op->len - 2; in d_expression()
2783 return d_make_comp (di, DEMANGLE_COMPONENT_UNARY, op, in d_expression()
2784 cplus_demangle_type (di)); in d_expression()
2807 && d_check_char (di, '_')) in d_expression()
2808 operand = d_exprlist (di); in d_expression()
2810 operand = d_expression (di); in d_expression()
2811 return d_make_comp (di, DEMANGLE_COMPONENT_UNARY, op, in d_expression()
2820 left = d_expression (di); in d_expression()
2822 right = d_exprlist (di); in d_expression()
2825 right = d_unqualified_name (di); in d_expression()
2826 if (d_peek_char (di) == 'I') in d_expression()
2827 right = d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE, in d_expression()
2828 right, d_template_args (di)); in d_expression()
2831 right = d_expression (di); in d_expression()
2833 return d_make_comp (di, DEMANGLE_COMPONENT_BINARY, op, in d_expression()
2834 d_make_comp (di, in d_expression()
2843 first = d_expression (di); in d_expression()
2844 second = d_expression (di); in d_expression()
2845 return d_make_comp (di, DEMANGLE_COMPONENT_TRINARY, op, in d_expression()
2846 d_make_comp (di, in d_expression()
2849 d_make_comp (di, in d_expression()
2852 d_expression (di)))); in d_expression()
2866 d_expr_primary (struct d_info *di) in d_expr_primary() argument
2870 if (! d_check_char (di, 'L')) in d_expr_primary()
2872 if (d_peek_char (di) == '_' in d_expr_primary()
2874 || d_peek_char (di) == 'Z') in d_expr_primary()
2875 ret = cplus_demangle_mangled_name (di, 0); in d_expr_primary()
2882 type = cplus_demangle_type (di); in d_expr_primary()
2890 di->expansion -= type->u.s_builtin.type->len; in d_expr_primary()
2904 if (d_peek_char (di) == 'n') in d_expr_primary()
2907 d_advance (di, 1); in d_expr_primary()
2909 s = d_str (di); in d_expr_primary()
2910 while (d_peek_char (di) != 'E') in d_expr_primary()
2912 if (d_peek_char (di) == '\0') in d_expr_primary()
2914 d_advance (di, 1); in d_expr_primary()
2916 ret = d_make_comp (di, t, type, d_make_name (di, s, d_str (di) - s)); in d_expr_primary()
2918 if (! d_check_char (di, 'E')) in d_expr_primary()
2928 d_local_name (struct d_info *di) in d_local_name() argument
2932 if (! d_check_char (di, 'Z')) in d_local_name()
2935 function = d_encoding (di, 0); in d_local_name()
2937 if (! d_check_char (di, 'E')) in d_local_name()
2940 if (d_peek_char (di) == 's') in d_local_name()
2942 d_advance (di, 1); in d_local_name()
2943 if (! d_discriminator (di)) in d_local_name()
2945 return d_make_comp (di, DEMANGLE_COMPONENT_LOCAL_NAME, function, in d_local_name()
2946 d_make_name (di, "string literal", in d_local_name()
2954 if (d_peek_char (di) == 'd') in d_local_name()
2957 d_advance (di, 1); in d_local_name()
2958 num = d_compact_number (di); in d_local_name()
2963 name = d_name (di); in d_local_name()
2972 if (! d_discriminator (di)) in d_local_name()
2976 name = d_make_default_arg (di, num, name); in d_local_name()
2977 return d_make_comp (di, DEMANGLE_COMPONENT_LOCAL_NAME, function, name); in d_local_name()
2987 d_discriminator (struct d_info *di) in d_discriminator() argument
2991 if (d_peek_char (di) != '_') in d_discriminator()
2993 d_advance (di, 1); in d_discriminator()
2994 discrim = d_number (di); in d_discriminator()
3003 d_lambda (struct d_info *di) in d_lambda() argument
3009 if (! d_check_char (di, 'U')) in d_lambda()
3011 if (! d_check_char (di, 'l')) in d_lambda()
3014 tl = d_parmlist (di); in d_lambda()
3018 if (! d_check_char (di, 'E')) in d_lambda()
3021 num = d_compact_number (di); in d_lambda()
3025 ret = d_make_empty (di); in d_lambda()
3033 if (! d_add_substitution (di, ret)) in d_lambda()
3042 d_unnamed_type (struct d_info *di) in d_unnamed_type() argument
3047 if (! d_check_char (di, 'U')) in d_unnamed_type()
3049 if (! d_check_char (di, 't')) in d_unnamed_type()
3052 num = d_compact_number (di); in d_unnamed_type()
3056 ret = d_make_empty (di); in d_unnamed_type()
3063 if (! d_add_substitution (di, ret)) in d_unnamed_type()
3072 d_add_substitution (struct d_info *di, struct demangle_component *dc) in d_add_substitution() argument
3076 if (di->next_sub >= di->num_subs) in d_add_substitution()
3078 di->subs[di->next_sub] = dc; in d_add_substitution()
3079 ++di->next_sub; in d_add_substitution()
3128 d_substitution (struct d_info *di, int prefix) in d_substitution() argument
3132 if (! d_check_char (di, 'S')) in d_substitution()
3135 c = d_next_char (di); in d_substitution()
3156 c = d_next_char (di); in d_substitution()
3163 if (id >= (unsigned int) di->next_sub) in d_substitution()
3166 ++di->did_subs; in d_substitution()
3168 return di->subs[id]; in d_substitution()
3176 verbose = (di->options & DMGL_VERBOSE) != 0; in d_substitution()
3181 peek = d_peek_char (di); in d_substitution()
3196 di->last_name = d_make_sub (di, p->set_last_name, in d_substitution()
3208 di->expansion += len; in d_substitution()
3209 return d_make_sub (di, s, len); in d_substitution()
4751 struct d_info *di) in cplus_demangle_init_info() argument
4753 di->s = mangled; in cplus_demangle_init_info()
4754 di->send = mangled + len; in cplus_demangle_init_info()
4755 di->options = options; in cplus_demangle_init_info()
4757 di->n = mangled; in cplus_demangle_init_info()
4762 di->num_comps = 2 * len; in cplus_demangle_init_info()
4763 di->next_comp = 0; in cplus_demangle_init_info()
4767 di->num_subs = len; in cplus_demangle_init_info()
4768 di->next_sub = 0; in cplus_demangle_init_info()
4769 di->did_subs = 0; in cplus_demangle_init_info()
4771 di->last_name = NULL; in cplus_demangle_init_info()
4773 di->expansion = 0; in cplus_demangle_init_info()
4793 struct d_info di; in d_demangle_callback() local
4811 cplus_demangle_init_info (mangled, options, strlen (mangled), &di); in d_demangle_callback()
4815 __extension__ struct demangle_component comps[di.num_comps]; in d_demangle_callback()
4816 __extension__ struct demangle_component *subs[di.num_subs]; in d_demangle_callback()
4818 di.comps = comps; in d_demangle_callback()
4819 di.subs = subs; in d_demangle_callback()
4821 di.comps = alloca (di.num_comps * sizeof (*di.comps)); in d_demangle_callback()
4822 di.subs = alloca (di.num_subs * sizeof (*di.subs)); in d_demangle_callback()
4828 dc = cplus_demangle_type (&di); in d_demangle_callback()
4831 dc = cplus_demangle_mangled_name (&di, 1); in d_demangle_callback()
4835 d_advance (&di, 11); in d_demangle_callback()
4836 dc = d_make_comp (&di, in d_demangle_callback()
4840 d_make_demangle_mangled_name (&di, d_str (&di)), in d_demangle_callback()
4842 d_advance (&di, strlen (d_str (&di))); in d_demangle_callback()
4850 if (((options & DMGL_PARAMS) != 0) && d_peek_char (&di) != '\0') in d_demangle_callback()
5083 struct d_info di; in is_ctor_or_dtor() local
5090 cplus_demangle_init_info (mangled, DMGL_GNU_V3, strlen (mangled), &di); in is_ctor_or_dtor()
5094 __extension__ struct demangle_component comps[di.num_comps]; in is_ctor_or_dtor()
5095 __extension__ struct demangle_component *subs[di.num_subs]; in is_ctor_or_dtor()
5097 di.comps = comps; in is_ctor_or_dtor()
5098 di.subs = subs; in is_ctor_or_dtor()
5100 di.comps = alloca (di.num_comps * sizeof (*di.comps)); in is_ctor_or_dtor()
5101 di.subs = alloca (di.num_subs * sizeof (*di.subs)); in is_ctor_or_dtor()
5104 dc = cplus_demangle_mangled_name (&di, 1); in is_ctor_or_dtor()