]> gcc.gnu.org Git - gcc.git/commitdiff
symtab.c (symtab_node::asm_name): Do not call printable name directly.
authorJan Hubicka <hubicka@ucw.cz>
Tue, 19 Jan 2016 11:51:18 +0000 (12:51 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 19 Jan 2016 11:51:18 +0000 (11:51 +0000)
* symtab.c (symtab_node::asm_name): Do not call printable name directly.
(symtab_node::name): Report name as unnamed if DECL_NAME is not set.

From-SVN: r232550

gcc/ChangeLog
gcc/symtab.c

index 907a528894bdf4bed4d57b60667c8ca3c8a03bb8..0272cd34391cae0a728550a378d0466818c64739 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-19  Jan Hubicka  <hubicka@ucw.cz>
+
+       * symtab.c (symtab_node::asm_name): Do not call printable name directly.
+       (symtab_node::name): Report name as unnamed if DECL_NAME is not set.
+
 2016-01-19  Martin Jambor  <mjambor@suse.cz>
            Martin Liska  <mliska@suse.cz>
            Michael Matz <matz@suse.de>
index 308a489206c3eb7a19fd23b156f1c8057fd236c2..523c95dd29eaa5ab228f6ea7e9721f05949b3b27 100644 (file)
@@ -504,7 +504,7 @@ const char *
 symtab_node::asm_name () const
 {
   if (!DECL_ASSEMBLER_NAME_SET_P (decl))
-    return lang_hooks.decl_printable_name (decl, 2);
+    return name ();
   return IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
 }
 
@@ -513,6 +513,13 @@ symtab_node::asm_name () const
 const char *
 symtab_node::name () const
 {
+  if (!DECL_NAME (decl))
+    {
+      if (DECL_ASSEMBLER_NAME_SET_P (decl))
+       return asm_name ();
+      else
+        return "<unnamed>";
+    }
   return lang_hooks.decl_printable_name (decl, 2);
 }
 
This page took 0.089688 seconds and 5 git commands to generate.