Remove ATTRIBUTE_UNUSED check from ARI
[deliverable/binutils-gdb.git] / binutils / stabs.c
index bf536075607889ae97f967b2919f0dab5018c9a6..e84aa6f1ac5b0b53a2d86ac7b8b9b853cc90f390 100644 (file)
@@ -1,5 +1,5 @@
 /* stabs.c -- Parse stabs debugging information
-   Copyright (C) 1995-2018 Free Software Foundation, Inc.
+   Copyright (C) 1995-2019 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -215,6 +215,8 @@ static debug_type stab_demangle_v3_arg
   (void *, struct stab_handle *, struct demangle_component *, debug_type,
    bfd_boolean *);
 
+static int demangle_flags = DMGL_ANSI;
+
 /* Save a string in memory.  */
 
 static char *
@@ -3035,27 +3037,15 @@ parse_stab_argtypes (void *dhandle, struct stab_handle *info,
          && fieldname[1] == 'p'
          && (fieldname[2] == '$' || fieldname[2] == '.'))
        {
-         const char *opname;
-
-         opname = cplus_mangle_opname (fieldname + 3, 0);
-         if (opname == NULL)
-           {
-             fprintf (stderr, _("No mangling for \"%s\"\n"), fieldname);
-             return DEBUG_TYPE_NULL;
-           }
-         mangled_name_len += strlen (opname);
-         physname = (char *) xmalloc (mangled_name_len);
-         strncpy (physname, fieldname, 3);
-         strcpy (physname + 3, opname);
+         /* Opname selection is no longer supported by libiberty's demangler.  */
+         return DEBUG_TYPE_NULL;
        }
+
+      physname = (char *) xmalloc (mangled_name_len);
+      if (is_constructor)
+       physname[0] = '\0';
       else
-       {
-         physname = (char *) xmalloc (mangled_name_len);
-         if (is_constructor)
-           physname[0] = '\0';
-         else
-           strcpy (physname, fieldname);
-       }
+       strcpy (physname, fieldname);
 
       physname_len = strlen (physname);
       strcat (physname, buf);
@@ -4517,7 +4507,7 @@ stab_demangle_template (struct stab_demangle_info *minfo, const char **pp,
 
       free (s1);
 
-      s3 = cplus_demangle (s2, DMGL_ANSI);
+      s3 = cplus_demangle (s2, demangle_flags);
 
       free (s2);
 
@@ -5243,7 +5233,7 @@ stab_demangle_v3_argtypes (void *dhandle, struct stab_handle *info,
   void *mem;
   debug_type *pargs;
 
-  dc = cplus_demangle_v3_components (physname, DMGL_PARAMS | DMGL_ANSI, &mem);
+  dc = cplus_demangle_v3_components (physname, DMGL_PARAMS | demangle_flags, &mem);
   if (dc == NULL)
     {
       stab_bad_demangle (physname);
@@ -5418,7 +5408,7 @@ stab_demangle_v3_arg (void *dhandle, struct stab_handle *info,
        /* We print this component to get a class name which we can
           use.  FIXME: This probably won't work if the template uses
           template parameters which refer to an outer template.  */
-       p = cplus_demangle_print (DMGL_PARAMS | DMGL_ANSI, dc, 20, &alc);
+       p = cplus_demangle_print (DMGL_PARAMS | demangle_flags, dc, 20, &alc);
        if (p == NULL)
          {
            fprintf (stderr, _("Failed to print demangled template\n"));
@@ -5498,7 +5488,7 @@ stab_demangle_v3_arg (void *dhandle, struct stab_handle *info,
        /* We print this component in order to find out the type name.
           FIXME: Should we instead expose the
           demangle_builtin_type_info structure?  */
-       p = cplus_demangle_print (DMGL_PARAMS | DMGL_ANSI, dc, 20, &alc);
+       p = cplus_demangle_print (DMGL_PARAMS | demangle_flags, dc, 20, &alc);
        if (p == NULL)
          {
            fprintf (stderr, _("Couldn't get demangled builtin type\n"));
This page took 0.029807 seconds and 4 git commands to generate.