Commit Graph

8 Commits

Author SHA1 Message Date
Iain Buclaw 59251a7367 d-demangle.c (dlang_type): Handle cent and ucent types.
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-16 16:50:08 +00:00
Iain Buclaw 7ce4461f37 d-demangle.c (dlang_attributes): Handle return attributes, ignoring return 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-16 16:49:57 +00:00
Iain Buclaw 5cc158e9a9 d-demangle.c (dlang_identifier): Check encoded length of identifier to 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-16 16:49:46 +00:00
Iain Buclaw fa66ced4bf d-demangle.c (dlang_type_modifiers): New function.
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-16 16:49:35 +00:00
Iain Buclaw 76b41cad1c d-demangle.c (dlang_call_convention): Return NULL if have reached the end of 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-16 16:49:25 +00:00
Iain Buclaw eb058b7de6 d-demangle.c (dlang_parse_string): Represent embedded whitespace or 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
2015-05-16 16:49:13 +00:00
Joel Brobecker 2a523cfe4e Use strtod instead of strtold in libiberty/d-demangle.c
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-10-14 17:57:08 +00:00
Iain Buclaw 43b1b9edfc demangle.h (DMGL_DLANG): New macro.
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
2014-09-23 18:36:14 +00:00