From 7842a9dbf8c304c7531d3e390ed320294934c0bc Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Thu, 27 Aug 2009 07:05:24 +0000 Subject: re PR debug/41170 (namespace DIE not generated when it contains only a typedef) Fix for PR debug/41170 gcc/ChangeLog: PR debug/41770 * dwarf2out.c (get_context_die): Declare this static function. (gen_type_die_with_usage): Make sure a DIE is a generated for the context of a typedef. gcc/testsuite/ChangeLog: PR debug/41770 * debug/dwarf2/namespace-1.C: New test. From-SVN: r151138 --- gcc/dwarf2out.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/dwarf2out.c') diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 2ee1df8..ad956f8 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -5887,6 +5887,7 @@ static void gen_type_die (tree, dw_die_ref); static void gen_block_die (tree, dw_die_ref, int); static void decls_for_scope (tree, dw_die_ref, int); static int is_redundant_typedef (const_tree); +static inline dw_die_ref get_context_die (tree); static void gen_namespace_die (tree, dw_die_ref); static void gen_decl_die (tree, tree, dw_die_ref); static dw_die_ref force_decl_die (tree); @@ -15436,7 +15437,7 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die, the type description DIE we want to generate. */ if (DECL_CONTEXT (TYPE_NAME (type)) && TREE_CODE (DECL_CONTEXT (TYPE_NAME (type))) == NAMESPACE_DECL) - context_die = lookup_decl_die (DECL_CONTEXT (TYPE_NAME (type))); + context_die = get_context_die (DECL_CONTEXT (TYPE_NAME (type))); TREE_ASM_WRITTEN (type) = 1; gen_decl_die (TYPE_NAME (type), NULL, context_die); -- cgit v1.1