aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cplus-dem.c
diff options
context:
space:
mode:
authorsamuel <samuel@138bc75d-0d04-0410-961f-82ee72b054a4>2000-06-05 02:28:41 +0000
committersamuel <samuel@138bc75d-0d04-0410-961f-82ee72b054a4>2000-06-05 02:28:41 +0000
commit168d63e571b2a83ad509b48044e6d76ebf8a9f2d (patch)
tree78bcc08424b6a7e0df57d6cc138363c0ec3e70eb /libiberty/cplus-dem.c
parent148e86d77b446be8be1a7cb09ae50812deb040df (diff)
In include,
* dyn-string.h: Move here from gcc/dyn-string.h. Add new functions. * demangle.h (DMGL_GNU_NEW_ABI): New macro. (DMGL_STYLE_MASK): Or in DMGL_GNU_NEW_ABI. (current_demangling_style): Add gnu_new_abi_demangling. (GNU_NEW_ABI_DEMANGLING_STYLE_STRING): New macro. (GNU_NEW_ABI_DEMANGLING): Likewise. (cplus_demangle_new_abi): New declaration. In libiberty, * Makefile.in (CFILES): Add cp-demangle.c and dyn-string.c. (REQUIRED_OFILES): Add cp-demangle.o and dyn-string.o. (cp-demangle.o): New dependency. (dyn-string.o): Likewise. * dyn-string.c: Move here from gcc/dyn-string.c. Add new functions. * cplus-dem.c (libiberty_demanglers): Add initializer for new-ABI demangler. (cplus_demangle): Call cplus_demangle_new_abi if in new-ABI demangling mode. (gnu_new_abi_symbol_characters): New function. (main): Use gnu_new_abi_symbol_characters. * cp-demangle.c: New file. * cp-demangle.c: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34397 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/cplus-dem.c')
-rw-r--r--libiberty/cplus-dem.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index 9ccce64e655..44d11968162 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -291,6 +291,12 @@ struct demangler_engine libiberty_demanglers[] =
}
,
{
+ GNU_NEW_ABI_DEMANGLING_STYLE_STRING,
+ gnu_new_abi_demangling,
+ "GNU (g++) new-ABI-style demangling"
+ }
+ ,
+ {
NULL, unknown_demangling, NULL
}
};
@@ -876,6 +882,10 @@ cplus_demangle (mangled, options)
if ((work -> options & DMGL_STYLE_MASK) == 0)
work -> options |= (int) current_demangling_style & DMGL_STYLE_MASK;
+ /* The new-ABI demangling is implemented elsewhere. */
+ if (GNU_NEW_ABI_DEMANGLING)
+ return cplus_demangle_new_abi (mangled);
+
ret = internal_cplus_demangle (work, mangled);
squangle_mop_up (work);
return (ret);
@@ -4574,6 +4584,9 @@ standard_symbol_characters PARAMS ((void));
static const char *
hp_symbol_characters PARAMS ((void));
+static const char *
+gnu_new_abi_symbol_characters PARAMS ((void));
+
/* Return the string of non-alnum characters that may occur
as a valid symbol component, in the standard assembler symbol
syntax. */
@@ -4622,6 +4635,17 @@ hp_symbol_characters ()
}
+/* Return the string of non-alnum characters that may occur
+ as a valid symbol component in the GNU standard C++ ABI mangling
+ scheme. */
+
+static const char *
+gnu_new_abi_symbol_characters ()
+{
+ return "_";
+}
+
+
extern int main PARAMS ((int, char **));
int
@@ -4696,6 +4720,9 @@ main (argc, argv)
case hp_demangling:
valid_symbols = hp_symbol_characters ();
break;
+ case gnu_new_abi_demangling:
+ valid_symbols = gnu_new_abi_symbol_characters ();
+ break;
default:
/* Folks should explicitly indicate the appropriate alphabet for
each demangling. Providing a default would allow the