diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-01-19 11:51:18 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-01-19 11:51:18 +0000 |
commit | 4e17ad5e30ceeb48a6de7706b6a506c817746ee2 (patch) | |
tree | bd7951fd91981ea60ea1c8e4bf19f7d50be1e64a /gcc/symtab.c | |
parent | 5668660879031f78bc693cd566f18bf726c34547 (diff) | |
download | gcc-4e17ad5e30ceeb48a6de7706b6a506c817746ee2.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232550 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/symtab.c')
-rw-r--r-- | gcc/symtab.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/symtab.c b/gcc/symtab.c index 308a489206c..523c95dd29e 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -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); } |