aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2005-06-09 18:21:36 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2005-06-09 16:21:36 +0000
commit30be951ac7b465e1f10da0f70744364a8e678366 (patch)
tree2fd919060d8ecfb55a3a393c028c7ba1f01c5856 /gcc/dwarf2out.c
parent2ffa9a0ce504d59abfa34e2b92d0f3e1aa3f6218 (diff)
downloadgcc-30be951ac7b465e1f10da0f70744364a8e678366.zip
gcc-30be951ac7b465e1f10da0f70744364a8e678366.tar.gz
gcc-30be951ac7b465e1f10da0f70744364a8e678366.tar.bz2
cgraphunit.c (cgraph_create_edges): Do not walk BLOCK; finalize local statics when doing unit-at-a-time.
* cgraphunit.c (cgraph_create_edges): Do not walk BLOCK; finalize local statics when doing unit-at-a-time. (cgraph_varpool_assemble_pending_decls): Output debug info. * dwarf2out.c (decls_for_scope): Skip local statics. (dwarf2out_decl): Handle local statics. * passes.c (rest_of_decl_compilation): Do not differentiate local and global statics in unit-at-a-time. * tree-inline.c (remap_decls): Put local static into unexpanded_vars_list rather than introducing duplicated VAR_DECL node. From-SVN: r100802
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 2fe28d5..1ae4990 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -12523,6 +12523,11 @@ decls_for_scope (tree stmt, dw_die_ref context_die, int depth)
if (die != NULL && die->die_parent == NULL)
add_child_die (context_die, die);
+ /* Do not produce debug information for static variables since
+ these might be optimized out. We are called for these later
+ in cgraph_varpool_analyze_pending_decls. */
+ if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
+ ;
else
gen_decl_die (decl, context_die);
}
@@ -13070,6 +13075,10 @@ dwarf2out_decl (tree decl)
if (DECL_EXTERNAL (decl) && !TREE_USED (decl))
return;
+ /* For local statics lookup proper context die. */
+ if (TREE_STATIC (decl) && decl_function_context (decl))
+ context_die = lookup_decl_die (DECL_CONTEXT (decl));
+
/* If we are in terse mode, don't generate any DIEs to represent any
variable declarations or definitions. */
if (debug_info_level <= DINFO_LEVEL_TERSE)