aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphbuild.c
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-07-06 02:26:33 +0000
committerNathan Froyd <froydnj@codesourcery.com>2010-07-06 02:26:33 +0000
commitf9c39b381e43cbeee6bf45cea69d026ad1d186f1 (patch)
treed191bb056818e7ad987268cffaf32a266a191f4c /gcc/cgraphbuild.c
parent3682df31b741864a6216f91a2ac1bea57572f647 (diff)
gcc/
* vec.h (FOR_EACH_VEC_ELT_REVERSE): New macro. * function.h (struct_function): Change type of local_decls field to a VEC. (add_local_decl): New function. (FOR_EACH_LOCAL_DECL): New macro. * cfgexpand.c (init_vars_expansion): Adjust for new type of cfun->local_decls. (estimated_stack_frame_size): Likewise. (expand_used_vars): Likewise. * cgraphbuild.c (build_cgraph_edges): Likewise. * function.c (instantiate_decls_1): Likewise. * ipa-struct-reorg.c (build_data_structure): Likewise. * ipa-type-escape.c (analyze_function): Likewise. * lto-streamer-in.c (input_function): Likewise. * lto-streamer-out.c (output_function): Likewise. * tree-ssa-live.c (remove_unused_locals): Likewise. * tree.c (free_lang_data_in_decl): Likewise. (find_decls_types_in_node): Likewise. * omp-low.c (remove_exit_barrier): Likewise. (expand_omp_taskreg): Likewise. (list2chain): Rename to... (vec2chain): ...this. Adjust. * cgraphunit.c (assemble_thunk): Call add_local_decl. * tree-cfg.c (replace_by_duplicate_decl): Likewise. * gimple-low.c (record_vars_into): Likewise. * tree-inline.c (remap_decls): Likewise. (declare_return_variable): Likewise. (declare_inline_vars): Likewise. (copy_forbidden): Adjust for new type of cfun->local_decls. (add_local_variables): New function. (expand_call_inline): Call it. (tree_function_versioning): Likewise. gcc/cp/ * decl.c (cp_finish_decl): Call add_local_decl. * optimize.c (clone_body): Adjust for new type of cfun->local_decls. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@161862 138bc75d-0d04-0410-961f-82ee72b054a4
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);