diff options
author | Nick Clifton <nickc@redhat.com> | 2017-03-01 15:09:29 +0000 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2017-03-02 09:29:33 +0100 |
commit | 95e5850793fc6979cf9fc089ca5f625ec30043bb (patch) | |
tree | 9e4c4aeb9d664a2e300c523f46cc3cadb62e884f | |
parent | 1b2d1fd5b9218f30a446d73641f16230f950c9d8 (diff) | |
download | gdb-95e5850793fc6979cf9fc089ca5f625ec30043bb.zip gdb-95e5850793fc6979cf9fc089ca5f625ec30043bb.tar.gz gdb-95e5850793fc6979cf9fc089ca5f625ec30043bb.tar.bz2 |
Sync libiberty sources with GCC mainline.
Brings in:
2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
PR PR c++/70182
* cp-demangle.c (d_unqualified_name): Handle "on" for
operator names.
* testsuite/demangle-expected: Add tests.
2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
PR c++/77489
* cp-demangle.c (d_discriminator): Handle discriminator >= 10.
* testsuite/demangle-expected: Add tests for discriminator.
2016-12-13 Jakub Jelinek <jakub@redhat.com>
PR c++/78761
* cp-demangle.c (cplus_demangle_type): Demangle Dc as decltype(auto).
* testsuite/demangle-expected: Add test for decltype(auto).
-rw-r--r-- | libiberty/ChangeLog | 60 | ||||
-rw-r--r-- | libiberty/cp-demangle.c | 24 | ||||
-rw-r--r-- | libiberty/testsuite/demangle-expected | 23 |
3 files changed, 89 insertions, 18 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 33ad3c7..b3f6f33 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,31 @@ +2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de> + + PR PR c++/70182 + * cp-demangle.c (d_unqualified_name): Handle "on" for + operator names. + * testsuite/demangle-expected: Add tests. + +2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de> + + PR c++/77489 + * cp-demangle.c (d_discriminator): Handle discriminator >= 10. + * testsuite/demangle-expected: Add tests for discriminator. + +2017-01-04 Jakub Jelinek <jakub@redhat.com> + + Update copyright years. + +2017-01-04 Alan Modra <amodra@gmail.com> + + * Makefile.in (configure_deps): Update. + * configure: Regenerate. + +2016-12-13 Jakub Jelinek <jakub@redhat.com> + + PR c++/78761 + * cp-demangle.c (cplus_demangle_type): Demangle Dc as decltype(auto). + * testsuite/demangle-expected: Add test for decltype(auto). + 2016-12-12 Nathan Sidwell <nathan@acm.org> PR c++/78252 @@ -20,6 +48,18 @@ * argv.c (expandargv): Check for directories passed as @-files. +2016-11-30 David Malcolm <dmalcolm@redhat.com> + + PR c/78498 + * strndup.c (strlen): Delete decl. + (strnlen): Add decl. + (strndup): Call strnlen rather than strlen. + * xstrndup.c (xstrndup): Likewise. + +2016-11-29 Nathan Sidwell <nathan@acm.org> + + * cp-demangle.c (d_print_comp_inner): Fix parameter indentation. + 2016-11-03 David Tolnay <dtolnay@gmail.com> Mark Wielaard <mark@klomp.org> @@ -86,10 +126,6 @@ * cplus-dem.c (ada_demangle): Initialize demangled to NULL and XDELETEVEC demangled when unknown. -2016-10-17 Nick Clifton <nickc@redhat.com> - - * Sync with gcc. - 2016-09-19 Andrew Stubbs <ams@codesourcery.com> * pex-win32.c (argv_to_cmdline): Quote zero-length parameters. @@ -345,11 +381,7 @@ (d_print_mod_list, d_print_mod, d_print_function_type) (is_ctor_or_dtor): Handle DEMANGLE_COMPONENT_TRANSACTION_SAFE. -2015-09-30 Nick Clifton <nickc@redhat.com> - - Import the following patches from the GCC mainline: - - 2015-08-15 Ian Lance Taylor <iant@google.com> +2015-08-15 Ian Lance Taylor <iant@google.com> * cp-demangle.c (d_abi_tags): Preserve di->last_name across any ABI tags. @@ -361,10 +393,6 @@ * testsuite/d-demangle-expected: Update float and complex literal tests to check correct hexadecimal demangling. -2015-07-14 H.J. Lu <hongjiu.lu@intel.com> - - * configure: Regenerated. - 2015-07-13 Mikhail Maltsev <maltsevm@gmail.com> * cp-demangle.c (d_dump): Fix syntax error. @@ -506,8 +534,8 @@ * functions.texi: Regenerate. 2014-12-11 Uros Bizjak <ubizjak@gmail.com> - Ben Elliston <bje@au.ibm.com> - Manuel Lopez-Ibanez <manu@gcc.gnu.org> + Ben Elliston <bje@au.ibm.com> + Manuel Lopez-Ibanez <manu@gcc.gnu.org> * xvasprintf.c: New file. * vprintf-support.h: Likewise. @@ -732,7 +760,7 @@ (d_ctor_dtor_name): Handle unified ctor/dtor. 2013-11-22 Cary Coutant <ccoutant@google.com> - + PR other/59195 * cp-demangle.c (struct d_info_checkpoint): New struct. (struct d_print_info): Add current_template field. diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 4671bc2..ef15a0b 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -1595,6 +1595,8 @@ d_unqualified_name (struct d_info *di) ret = d_source_name (di); else if (IS_LOWER (peek)) { + if (peek == 'o' && d_peek_next_char (di) == 'n') + d_advance (di, 2); ret = d_operator_name (di); if (ret != NULL && ret->type == DEMANGLE_COMPONENT_OPERATOR) { @@ -3606,7 +3608,11 @@ d_local_name (struct d_info *di) } } -/* <discriminator> ::= _ <(non-negative) number> +/* <discriminator> ::= _ <number> # when number < 10 + ::= __ <number> _ # when number >= 10 + + <discriminator> ::= _ <number> # when number >=10 + is also accepted to support gcc versions that wrongly mangled that way. We demangle the discriminator, but we don't print it out. FIXME: We should print it out in verbose mode. */ @@ -3614,14 +3620,28 @@ d_local_name (struct d_info *di) static int d_discriminator (struct d_info *di) { - int discrim; + int discrim, num_underscores = 1; if (d_peek_char (di) != '_') return 1; d_advance (di, 1); + if (d_peek_char (di) == '_') + { + ++num_underscores; + d_advance (di, 1); + } + discrim = d_number (di); if (discrim < 0) return 0; + if (num_underscores > 1 && discrim >= 10) + { + if (d_peek_char (di) == '_') + d_advance (di, 1); + else + return 0; + } + return 1; } diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index 803decd..f039893 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -4663,3 +4663,26 @@ void eat<int*, Foo()::{lambda(auto:1*, auto:2*)#6}>(int*&, Foo()::{lambda(auto:1 _Z3eatIPiZ3BarIsEvvEUlPsPT_PT0_E0_EvRS3_RS5_ void eat<int*, void Bar<short>()::{lambda(short*, auto:1*, auto:2*)#2}>(int*&, void Bar<short>()::{lambda(short*, auto:1*, auto:2*)#2}&) + +# PR 77489 +_ZZ3foovE8localVar_9 +foo()::localVar + +_ZZ3foovE8localVar_10 +foo()::localVar + +_ZZ3foovE8localVar__10_ +foo()::localVar + +_ZZ3foovE8localVar__9_ +_ZZ3foovE8localVar__9_ + +_ZZ3foovE8localVar__12 +_ZZ3foovE8localVar__12 + +# PR 70182 +_Z1gI1AEv1SIXadsrT_onplEE +void g<A>(S<&A::operator+>) + +_Z1gI1AEv1SIXadsrT_plEE +void g<A>(S<&A::operator+>) |