OSDN Git Service

* config/alpha/alpha.c (reg_no_subreg_operand): Reject all
[pf3gnuchains/gcc-fork.git] / libiberty / cplus-dem.c
index a464f45..159f8d5 100644 (file)
@@ -259,6 +259,12 @@ typedef enum type_kind_t
 const struct demangler_engine libiberty_demanglers[] =
 {
   {
+    NO_DEMANGLING_STYLE_STRING,
+    no_demangling,
+    "Demangling disabled"
+  }
+  ,
+  {
     AUTO_DEMANGLING_STYLE_STRING,
       auto_demangling,
       "Automatic selection based on executable"
@@ -568,6 +574,9 @@ consume_count (type)
       (*type)++;
     }
 
+  if (count < 0)
+    count = -1;
+
   return (count);
 }
 
@@ -877,7 +886,7 @@ cplus_demangle_name_to_style (name)
 /* char *cplus_demangle (const char *mangled, int options)
 
    If MANGLED is a mangled function name produced by GNU C++, then
-   a pointer to a malloced string giving a C++ representation
+   a pointer to a @code{malloc}ed string giving a C++ representation
    of the name will be returned; otherwise NULL will be returned.
    It is the caller's responsibility to free the string which
    is returned.
@@ -909,6 +918,10 @@ cplus_demangle (mangled, options)
 {
   char *ret;
   struct work_stuff work[1];
+
+  if (current_demangling_style == no_demangling)
+    return xstrdup (mangled);
+
   memset ((char *) work, 0, sizeof (work));
   work->options = options;
   if ((work->options & DMGL_STYLE_MASK) == 0)