summaryrefslogtreecommitdiff
path: root/libiberty/cplus-dem.c
diff options
context:
space:
mode:
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