couple of fixes for cp-demangle.c
Zack Weinberg
zack@wolery.cumb.org
Fri Jun 9 11:54:00 GMT 2000
On Thu, Jun 08, 2000 at 11:05:15PM -0700, Mark Mitchell wrote:
> >>>>> "Zack" == Zack Weinberg <zack@wolery.cumb.org> writes:
>
> Zack> Okay. But we want to demangle them anyway, right?
>
> Yes.
>
> Zack> Mmm... Gaby's tastes and mine differ violently. (He's the
> Zack> one who likes "char* foo", right?) But I'll implement
> Zack> whatever the consensus is.
>
> I actually agree with you. But, the V3 people have bothered to write
> coding standards -- and they say no space for `operator=='. So, I
> think that's as close to a GNU standard on the spelling as we're going
> to get, and you and I should probably adjust our tastes. :-)
Very well. I have committed the following patch.
I was going to throw in support for your Java builtin types, but u is
expected to be followed by a <source-name> not a code letter -
implying that __java_int ought to be mangled as u10__java_int not
uji. Or is there more leeway in the spec?
c++filt requires you to give '-s gnu-new-abi' on the command line
before it will recognize new mangled names; I don't know how to fix this.
zw
* cp-demangle.c (demangle_operator_name): Add spaces before
names beginning with a letter: delete, delete[], new, new[],
sizeof.
(demangle_special_name): Handle TF <type> and TJ <type>.
===================================================================
Index: cp-demangle.c
--- cp-demangle.c 2000/06/08 16:51:44 1.6
+++ cp-demangle.c 2000/06/09 17:24:22
@@ -1327,9 +1327,9 @@ demangle_operator_name (dm, short_name,
{ "cm", "," , 2 },
{ "co", "~" , 1 },
{ "dV", "/=" , 2 },
- { "da", "delete[]" , 1 },
+ { "da", " delete[]", 1 },
{ "de", "*" , 1 },
- { "dl", "delete" , 1 },
+ { "dl", " delete" , 1 },
{ "dv", "/" , 2 },
{ "eO", "^=" , 2 },
{ "eo", "^" , 2 },
@@ -1346,11 +1346,11 @@ demangle_operator_name (dm, short_name,
{ "mi", "-" , 2 },
{ "ml", "*" , 2 },
{ "mm", "--" , 1 },
- { "na", "new[]" , 1 },
+ { "na", " new[]" , 1 },
{ "ne", "!=" , 2 },
{ "ng", "-" , 1 },
{ "nt", "!" , 1 },
- { "nw", "new" , 1 },
+ { "nw", " new" , 1 },
{ "oR", "|=" , 2 },
{ "oo", "||" , 2 },
{ "or", "|" , 2 },
@@ -1364,7 +1364,7 @@ demangle_operator_name (dm, short_name,
{ "rS", ">>=" , 2 },
{ "rm", "%" , 2 },
{ "rs", ">>" , 2 },
- { "sz", "sizeof" , 1 }
+ { "sz", " sizeof" , 1 }
};
const int num_operators =
@@ -1439,10 +1439,12 @@ demangle_operator_name (dm, short_name,
::= TI <type> # typeinfo structure
::= TS <type> # typeinfo name
- Also demangles the special g++ mangling,
+ Also demangles the special g++ manglings,
<special-name> ::= CT <type> <offset number> _ <base type>
- # construction vtable */
+ # construction vtable
+ ::= TF <type> # typeinfo function (old ABI only)
+ ::= TJ <type> # java Class structure */
static status_t
demangle_special_name (dm)
@@ -1490,10 +1492,24 @@ demangle_special_name (dm)
RETURN_IF_ERROR (demangle_type (dm));
break;
+ case 'F':
+ /* Typeinfo function. Used only in old ABI with new mangling. */
+ advance_char (dm);
+ result_append (dm, "typeinfo fn for ");
+ RETURN_IF_ERROR (demangle_type (dm));
+ break;
+
case 'S':
/* Character string containing type name, used in typeinfo. */
advance_char (dm);
result_append (dm, "typeinfo name for ");
+ RETURN_IF_ERROR (demangle_type (dm));
+ break;
+
+ case 'J':
+ /* The java Class variable corresponding to a C++ class. */
+ advance_char (dm);
+ result_append (dm, "java Class for ");
RETURN_IF_ERROR (demangle_type (dm));
break;
More information about the Gcc-patches
mailing list