diff options
author | Jason Merrill <jason@redhat.com> | 2012-11-10 21:11:15 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2012-11-10 21:11:15 -0500 |
commit | c61e8502c1ea36112a24b80015e0b8a484c61946 (patch) | |
tree | 43336c2888d5d1f6d7ac6a4fdcd190c36ecd1f88 /libiberty | |
parent | c417597c1ff9a0607a56d46199dabbf470b0edf6 (diff) | |
download | gcc-c61e8502c1ea36112a24b80015e0b8a484c61946.zip gcc-c61e8502c1ea36112a24b80015e0b8a484c61946.tar.gz gcc-c61e8502c1ea36112a24b80015e0b8a484c61946.tar.bz2 |
cp-demangle.c (d_unqualified_name): Handle abi tags here.
* cp-demangle.c (d_unqualified_name): Handle abi tags here.
(d_name): Not here.
From-SVN: r193401
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 5 | ||||
-rw-r--r-- | libiberty/cp-demangle.c | 38 | ||||
-rw-r--r-- | libiberty/testsuite/demangle-expected | 3 |
3 files changed, 24 insertions, 22 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index af12cd8..7ecd6da 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2012-11-10 Jason Merrill <jason@redhat.com> + + * cp-demangle.c (d_unqualified_name): Handle abi tags here. + (d_name): Not here. + 2012-11-09 Jason Merrill <jason@redhat.com> * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_TAGGED_NAME. diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 86c7747..913d4bf 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -1246,17 +1246,14 @@ d_name (struct d_info *di) switch (peek) { case 'N': - dc = d_nested_name (di); - break; + return d_nested_name (di); case 'Z': - dc = d_local_name (di); - break; + return d_local_name (di); case 'L': case 'U': - dc = d_unqualified_name (di); - break; + return d_unqualified_name (di); case 'S': { @@ -1298,7 +1295,7 @@ d_name (struct d_info *di) d_template_args (di)); } - break; + return dc; } default: @@ -1313,12 +1310,8 @@ d_name (struct d_info *di) dc = d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE, dc, d_template_args (di)); } - break; + return dc; } - - if (d_peek_char (di) == 'B') - dc = d_abi_tags (di, dc); - return dc; } /* <nested-name> ::= N [<CV-qualifiers>] <prefix> <unqualified-name> E @@ -1446,15 +1439,14 @@ d_prefix (struct d_info *di) static struct demangle_component * d_unqualified_name (struct d_info *di) { + struct demangle_component *ret; char peek; peek = d_peek_char (di); if (IS_DIGIT (peek)) - return d_source_name (di); + ret = d_source_name (di); else if (IS_LOWER (peek)) { - struct demangle_component *ret; - ret = d_operator_name (di); if (ret != NULL && ret->type == DEMANGLE_COMPONENT_OPERATOR) { @@ -1463,14 +1455,11 @@ d_unqualified_name (struct d_info *di) ret = d_make_comp (di, DEMANGLE_COMPONENT_UNARY, ret, d_source_name (di)); } - return ret; } else if (peek == 'C' || peek == 'D') - return d_ctor_dtor_name (di); + ret = d_ctor_dtor_name (di); else if (peek == 'L') { - struct demangle_component * ret; - d_advance (di, 1); ret = d_source_name (di); @@ -1478,22 +1467,27 @@ d_unqualified_name (struct d_info *di) return NULL; if (! d_discriminator (di)) return NULL; - return ret; } else if (peek == 'U') { switch (d_peek_next_char (di)) { case 'l': - return d_lambda (di); + ret = d_lambda (di); + break; case 't': - return d_unnamed_type (di); + ret = d_unnamed_type (di); + break; default: return NULL; } } else return NULL; + + if (d_peek_char (di) == 'B') + ret = d_abi_tags (di, ret); + return ret; } /* <source-name> ::= <(positive length) number> <identifier> */ diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index 6b55d30..5b41b03 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -4084,6 +4084,9 @@ auto& f<int>(int const&, int) --format=gnu-v3 _Z1gILi1EEvR1AIXT_EER1BIXscbT_EE void g<1>(A<1>&, B<static_cast<bool>(1)>&) +--format=gnu-v3 +_ZNKSt7complexIiE4realB5cxx11Ev +std::complex<int>::real[abi:cxx11]() const # # Ada (GNAT) tests. # |