aboutsummaryrefslogtreecommitdiff
path: root/libiberty/d-demangle.c
AgeCommit message (Collapse)AuthorFilesLines
2015-08-11Fix test failure on Solaris 9 where strtod() does not accept hexadecimalsIain Buclaw1-11/+4
2015-08-11 Iain Buclaw <ibuclaw@gdcproject.org> libiberty/ * d-demangle.c (dlang_parse_real): Remove call to strtod. (strtod): Remove declaration. * testsuite/d-demangle-expected: Update float and complex literal tests to check correct hexadecimal demangling. From-SVN: r226774
2015-05-16d-demangle.c (dlang_symbol_kinds): New enum.Iain Buclaw1-44/+141
libiberty/ChangeLog: 2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org> * d-demangle.c (dlang_symbol_kinds): New enum. (dlang_parse_symbol): Update signature. Handle an ambiguity between pascal functions and template value arguments. Only check for a type if parsing a function, or at the top level. Return failure if the entire symbol was not successfully demangled. (dlang_identifier): Update signature. Handle an ambiguity between two adjacent digits in a mangled symbol string. (dlang_type): Update call to dlang_parse_symbol. (dlang_template_args): Likewise. (dlang_parse_template): Likewise. (dlang_demangle): Likewise. * testsuite/d-demangle-expected: Fix bad tests found, and add problematic examples to the unittests. From-SVN: r223247
2015-05-16d-demangle.c (dlang_template_args): Skip over specialized template ↵Iain Buclaw1-0/+4
parameters in mangled symbol. libiberty/ChangeLog: 2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org> * d-demangle.c (dlang_template_args): Skip over specialized template parameters in mangled symbol. * testsuite/d-demangle-expected: Add coverage and unittest for specialized template parameters. From-SVN: r223246
2015-05-16d-demangle.c (dlang_type): Handle cent and ucent types.Iain Buclaw1-0/+14
libiberty/ChangeLog: 2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org> * d-demangle.c (dlang_type): Handle cent and ucent types. * testsuite/d-demangle-expected: Add coverage tests for cent and ucent. From-SVN: r223245
2015-05-16d-demangle.c (dlang_attributes): Handle return attributes, ignoring return ↵Iain Buclaw1-0/+15
parameters in the mangled string. libiberty/ChangeLog: 2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org> * d-demangle.c (dlang_attributes): Handle return attributes, ignoring return parameters in the mangled string. Return NULL if have encountered an unknown attribute. (dlang_function_args): Handle return parameters in the mangled string. * testsuite/d-demangle-expected: Add coverage tests for functions with return parameters and return attributes. From-SVN: r223244
2015-05-16d-demangle.c (dlang_identifier): Check encoded length of identifier to ↵Iain Buclaw1-58/+75
verify strncmp matches entire string. libiberty/ChangeLog: 2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org> * d-demangle.c (dlang_identifier): Check encoded length of identifier to verify strncmp matches entire string. * testsuite/d-demangle-expected: Fix wrong test for postblit symbol. From-SVN: r223243
2015-05-16d-demangle.c (dlang_type_modifiers): New function.Iain Buclaw1-13/+98
libiberty/ChangeLog: 2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org> * d-demangle.c (dlang_type_modifiers): New function. (dlang_type_modifier_p): New function. (dlang_call_convention_p): Ignore any kind of type modifier. (dlang_type): Handle and emit the type modifier after delegate types. (dlang_parse_symbol): Handle and emit the type modifier after the symbol. * testsuite/d-demangle-expected: Add coverage tests for all valid usages of function symbols with type modifiers. From-SVN: r223242
2015-05-16d-demangle.c (dlang_call_convention): Return NULL if have reached the end of ↵Iain Buclaw1-6/+6
the symbol, but expected something to read. libiberty/ChangeLog: 2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org> * d-demangle.c (dlang_call_convention): Return NULL if have reached the end of the symbol, but expected something to read. (dlang_attributes): Likewise. (dlang_function_type): Likewise. (dlang_type): Likewise. (dlang_identifier): Likewise. (dlang_value): Likewise. From-SVN: r223241
2015-05-16d-demangle.c (dlang_parse_string): Represent embedded whitespace or ↵Iain Buclaw1-2/+33
non-printable characters as hex or escape... libiberty/ChangeLog: 2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org> * d-demangle.c (dlang_parse_string): Represent embedded whitespace or non-printable characters as hex or escape sequences. * testsuite/d-demangle-expected: Add test for templates with tabs and newlines embedded into the signature. From-SVN: r223240
2014-10-14Use strtod instead of strtold in libiberty/d-demangle.cJoel Brobecker1-5/+5
strtold is currently used to decode templates which have a floating-point value encoded inside; but this routine is not available on some systems, such as Solaris 2.9 for instance. This patch fixes the issue by replace the use of strtold by strtod. It reduces a bit the precision, but it should still remain acceptable in most cases. libiberty/ChangeLog: * d-demangle.c: Replace strtold with strtod in global comment. (strtold): Remove declaration. (strtod): New declaration. (dlang_parse_real): Declare value as double instead of long double. Replace call to strtold by call to strtod. Update format in call to snprintf. From-SVN: r216216
2014-09-23demangle.h (DMGL_DLANG): New macro.Iain Buclaw1-0/+1338
include/: * demangle.h (DMGL_DLANG): New macro. (DMGL_STYLE_MASK): Add DMGL_DLANG. (demangling_styles): Add dlang_demangling. (DLANG_DEMANGLING_STYLE_STRING): New macro. (DLANG_DEMANGLING): New macro. (dlang_demangle): New prototype. libiberty/: * Makefile.in (CFILES): Add d-demangle.c. (REQUIRED_OFILES): Add d-demangle.o. * cplus-dem.c (libiberty_demanglers): Add dlang_demangling case. (cplus_demangle): Likewise. * d-demangle.c: New file. * testsuite/Makefile.in (really-check): Add check-d-demangle. * testsuite/d-demangle-expected: New file. From-SVN: r215530