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
This commit is contained in:
Jason Merrill 2012-11-10 21:11:15 -05:00 committed by Jason Merrill
parent c417597c1f
commit c61e8502c1
3 changed files with 24 additions and 22 deletions

View File

@ -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.

View File

@ -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> */

View File

@ -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.
#