diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-03-17 18:49:28 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2009-03-17 18:49:28 +0100 |
commit | a3f596ba3de6975109c5d3d5900a1693cfebb96d (patch) | |
tree | 10fca5d7225e35a93769e3b741ec499d6757e765 /gcc/dwarf2out.c | |
parent | 6b2b88712792698e1348e585ab91fa8518a250f0 (diff) | |
download | gcc-a3f596ba3de6975109c5d3d5900a1693cfebb96d.zip gcc-a3f596ba3de6975109c5d3d5900a1693cfebb96d.tar.gz gcc-a3f596ba3de6975109c5d3d5900a1693cfebb96d.tar.bz2 |
re PR debug/39471 (DW_TAG_imported_module should be used (not DW_TAG_imported_declaration))
PR debug/39471
* dwarf2out.c (dwarf2out_imported_module_or_decl_1): Emit
DW_TAG_imported_module even if decl is IMPORTED_DECL with
NAMESPACE_DECL in its DECL_INITIAL.
* cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
on IMPORTED_DECL.
* g++.dg/debug/dwarf2/imported-module-2.C: Expect
DW_TAG_imported_module, not just any DW_TAG_imported prefixed tag.
* g++.dg/debug/dwarf2/imported-module-3.C: Likewise.
* g++.dg/debug/dwarf2/imported-module-4.C: Likewise.
From-SVN: r144911
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 6711777..79651e1 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -15380,12 +15380,11 @@ dwarf2out_imported_module_or_decl_1 (tree decl, } else if (TREE_CODE (decl) == IMPORTED_DECL) { - tree imported_ns_decl; + tree imported_ns_decl = IMPORTED_DECL_ASSOCIATED_DECL (decl); /* IMPORTED_DECL nodes that are not imported namespace are just not supported yet. */ - gcc_assert (DECL_INITIAL (decl) - && TREE_CODE (DECL_INITIAL (decl)) == NAMESPACE_DECL); - imported_ns_decl = DECL_INITIAL (decl); + gcc_assert (imported_ns_decl + && TREE_CODE (imported_ns_decl) == NAMESPACE_DECL); at_import_die = lookup_decl_die (imported_ns_decl); if (!at_import_die) at_import_die = force_decl_die (imported_ns_decl); @@ -15414,7 +15413,10 @@ dwarf2out_imported_module_or_decl_1 (tree decl, } } - if (TREE_CODE (decl) == NAMESPACE_DECL) + if (TREE_CODE (decl) == NAMESPACE_DECL + || (TREE_CODE (decl) == IMPORTED_DECL + && (TREE_CODE (IMPORTED_DECL_ASSOCIATED_DECL (decl)) + == NAMESPACE_DECL))) imported_die = new_die (DW_TAG_imported_module, lexical_block_die, lexical_block); |