summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-17 17:51:10 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-17 17:51:10 +0000
commit169f8686c6797293287a779b21f149c97fc5ae23 (patch)
tree5ab1be5d5e3b7f945f926c7a5c43cc8ad41b7ddc /gcc/dwarf2out.c
parent157e283b1c7aed35b46679dc9decaa656dd310d0 (diff)
downloadgcc-169f8686c6797293287a779b21f149c97fc5ae23.tar.gz
* dwarf2out.c (dwarf2out_imported_module_or_decl_1): Allow
non-NAMESPACE_DECL IMPORTED_DECL_ASSOCIATED_DECL. * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs instead of calling imported_module_or_decl debug hook if building_stmt_tree (). * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand is a NAMESPACE_DECL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144912 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 79651e135a0..3ea146881dc 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -15361,6 +15361,15 @@ dwarf2out_imported_module_or_decl_1 (tree decl,
dw_die_ref imported_die = NULL;
dw_die_ref at_import_die;
+ if (TREE_CODE (decl) == IMPORTED_DECL)
+ {
+ xloc = expand_location (DECL_SOURCE_LOCATION (decl));
+ decl = IMPORTED_DECL_ASSOCIATED_DECL (decl);
+ gcc_assert (decl);
+ }
+ else
+ xloc = expand_location (input_location);
+
if (TREE_CODE (decl) == TYPE_DECL || TREE_CODE (decl) == CONST_DECL)
{
if (is_base_type (TREE_TYPE (decl)))
@@ -15378,18 +15387,6 @@ dwarf2out_imported_module_or_decl_1 (tree decl,
gcc_assert (at_import_die);
}
}
- else if (TREE_CODE (decl) == IMPORTED_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 (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);
- gcc_assert (at_import_die);
- }
else
{
at_import_die = lookup_decl_die (decl);
@@ -15413,10 +15410,7 @@ dwarf2out_imported_module_or_decl_1 (tree decl,
}
}
- if (TREE_CODE (decl) == NAMESPACE_DECL
- || (TREE_CODE (decl) == IMPORTED_DECL
- && (TREE_CODE (IMPORTED_DECL_ASSOCIATED_DECL (decl))
- == NAMESPACE_DECL)))
+ if (TREE_CODE (decl) == NAMESPACE_DECL)
imported_die = new_die (DW_TAG_imported_module,
lexical_block_die,
lexical_block);
@@ -15425,10 +15419,6 @@ dwarf2out_imported_module_or_decl_1 (tree decl,
lexical_block_die,
lexical_block);
- if (TREE_CODE (decl) == IMPORTED_DECL)
- xloc = expand_location (DECL_SOURCE_LOCATION (decl));
- else
- xloc = expand_location (input_location);
add_AT_file (imported_die, DW_AT_decl_file, lookup_filename (xloc.file));
add_AT_unsigned (imported_die, DW_AT_decl_line, xloc.line);
if (name)