summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-04 23:32:08 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-04 23:32:08 +0000
commit03fc4c8b2f307858193f54c6bab445b6c2a693b8 (patch)
tree13236b211e435781d93b695c641cf2855a836389 /gcc/dwarf2out.c
parent7d22af628d4995206fa001c9c2425acfe2be1b4f (diff)
downloadgcc-03fc4c8b2f307858193f54c6bab445b6c2a693b8.tar.gz
PR debug/45171
* dwarf2out.c (gen_typedef_die): Don't re-generate the die of an is_naming_typedef_decl. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162882 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 95de4687f50..651642af507 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -19785,22 +19785,24 @@ gen_typedef_die (tree decl, dw_die_ref context_die)
type = TREE_TYPE (decl);
if (is_naming_typedef_decl (TYPE_NAME (type)))
- /*
- Here, we are in the case of decl being a typedef naming
- an anonymous type, e.g:
+ {
+ /* Here, we are in the case of decl being a typedef naming
+ an anonymous type, e.g:
typedef struct {...} foo;
- In that case TREE_TYPE (decl) is not a typedef variant
- type and TYPE_NAME of the anonymous type is set to the
- TYPE_DECL of the typedef. This construct is emitted by
- the C++ FE.
-
- TYPE is the anonymous struct named by the typedef
- DECL. As we need the DW_AT_type attribute of the
- DW_TAG_typedef to point to the DIE of TYPE, let's
- generate that DIE right away. add_type_attribute
- called below will then pick (via lookup_type_die) that
- anonymous struct DIE. */
- gen_tagged_type_die (type, context_die, DINFO_USAGE_DIR_USE);
+ In that case TREE_TYPE (decl) is not a typedef variant
+ type and TYPE_NAME of the anonymous type is set to the
+ TYPE_DECL of the typedef. This construct is emitted by
+ the C++ FE.
+
+ TYPE is the anonymous struct named by the typedef
+ DECL. As we need the DW_AT_type attribute of the
+ DW_TAG_typedef to point to the DIE of TYPE, let's
+ generate that DIE right away. add_type_attribute
+ called below will then pick (via lookup_type_die) that
+ anonymous struct DIE. */
+ if (!TREE_ASM_WRITTEN (type))
+ gen_tagged_type_die (type, context_die, DINFO_USAGE_DIR_USE);
+ }
}
add_type_attribute (type_die, type, TREE_READONLY (decl),