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/cp-demangle.c | |
parent | c417597c1ff9a0607a56d46199dabbf470b0edf6 (diff) | |
download | gcc-c61e8502c1ea36112a24b80015e0b8a484c61946.tar.gz |
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/cp-demangle.c')
-rw-r--r-- | libiberty/cp-demangle.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 86c77471200..913d4bf09d4 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> */ |