diff options
author | rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4> | 1992-11-24 05:18:35 +0000 |
---|---|---|
committer | rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4> | 1992-11-24 05:18:35 +0000 |
commit | 3d95713a7f53828ede256bd1663fae193cc1bcd1 (patch) | |
tree | 36b4c7f7e7c04f0e8ceff47c1bfd3be6d8351539 /gcc/sdbout.c | |
parent | 8d9dfbf66e3876efb601c5a0c0053c14dc5d20af (diff) | |
download | gcc-3d95713a7f53828ede256bd1663fae193cc1bcd1.tar.gz |
(template_name_p): New function.
(sdbout_record_type_name): Use it to possibly use the
DECL_ASSEMBLER_NAME instead of DECL_NAME if looking at a template.
(sdbout_symbol): Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2787 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sdbout.c')
-rw-r--r-- | gcc/sdbout.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/sdbout.c b/gcc/sdbout.c index 4557817649d..04093a83d81 100644 --- a/gcc/sdbout.c +++ b/gcc/sdbout.c @@ -387,6 +387,17 @@ plain_type (type) return val; } +static int +template_name_p (name) + tree name; +{ + register char *ptr = IDENTIFIER_POINTER (name); + while (*ptr && *ptr != '<') + ptr++; + + return *ptr != '\0'; +} + static void sdbout_record_type_name (type) tree type; @@ -410,11 +421,16 @@ sdbout_record_type_name (type) && TYPE_LANG_SPECIFIC (type)) { t = DECL_NAME (TYPE_NAME (type)); + /* The DECL_NAME for templates includes "<>", which breaks + most assemblers. Use its assembler name instead, which + has been mangled into being safe. */ + if (t && template_name_p (t)) + t = DECL_ASSEMBLER_NAME (TYPE_NAME (type)); } #endif /* Now get the name as a string, or invent one. */ - if (t != 0) + if (t != NULL_TREE) name = IDENTIFIER_POINTER (t); } @@ -636,7 +652,10 @@ sdbout_symbol (decl, local) return; /* Output typedef name. */ - PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_NAME (decl))); + if (template_name_p (DECL_NAME (decl))) + PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))); + else + PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_NAME (decl))); PUT_SDB_SCL (C_TPDEF); break; |