summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-11 02:11:15 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-11 02:11:15 +0000
commit185be9f5d2155216c4d7142f63a72de3d5695810 (patch)
tree43336c2888d5d1f6d7ac6a4fdcd190c36ecd1f88 /libiberty
parent53e542225d3d8e997df29c5e4ac23851686da776 (diff)
downloadgcc-185be9f5d2155216c4d7142f63a72de3d5695810.tar.gz
* cp-demangle.c (d_unqualified_name): Handle abi tags here.
(d_name): Not here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193401 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog5
-rw-r--r--libiberty/cp-demangle.c38
-rw-r--r--libiberty/testsuite/demangle-expected3
3 files changed, 24 insertions, 22 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index af12cd86470..7ecd6da140e 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 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> */
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 6b55d30298e..5b41b03f9fa 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.
#