summaryrefslogtreecommitdiff
path: root/gcc/cgraphbuild.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraphbuild.c')
-rw-r--r--gcc/cgraphbuild.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index 9dcb8623167..3bd42e34039 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -328,7 +328,8 @@ build_cgraph_edges (void)
struct cgraph_node *node = cgraph_node (current_function_decl);
struct pointer_set_t *visited_nodes = pointer_set_create ();
gimple_stmt_iterator gsi;
- tree step;
+ tree decl;
+ unsigned ix;
/* Create the callgraph edges and record the nodes referenced by the function.
body. */
@@ -378,15 +379,10 @@ build_cgraph_edges (void)
}
/* Look for initializers of constant variables and private statics. */
- for (step = cfun->local_decls;
- step;
- step = TREE_CHAIN (step))
- {
- tree decl = TREE_VALUE (step);
- if (TREE_CODE (decl) == VAR_DECL
- && (TREE_STATIC (decl) && !DECL_EXTERNAL (decl)))
- varpool_finalize_decl (decl);
- }
+ FOR_EACH_LOCAL_DECL (cfun, ix, decl)
+ if (TREE_CODE (decl) == VAR_DECL
+ && (TREE_STATIC (decl) && !DECL_EXTERNAL (decl)))
+ varpool_finalize_decl (decl);
record_eh_tables (node, cfun);
pointer_set_destroy (visited_nodes);