diff options
author | Nathan Froyd <froydnj@codesourcery.com> | 2010-07-06 02:26:33 +0000 |
---|---|---|
committer | Nathan Froyd <froydnj@gcc.gnu.org> | 2010-07-06 02:26:33 +0000 |
commit | c021f10b188584445b45ec9649cff4d39e640c3e (patch) | |
tree | d191bb056818e7ad987268cffaf32a266a191f4c /gcc/tree-cfg.c | |
parent | 979cc399477378ad45eb030ef5029e35c6be4371 (diff) | |
download | gcc-c021f10b188584445b45ec9649cff4d39e640c3e.zip gcc-c021f10b188584445b45ec9649cff4d39e640c3e.tar.gz gcc-c021f10b188584445b45ec9649cff4d39e640c3e.tar.bz2 |
vec.h (FOR_EACH_VEC_ELT_REVERSE): New macro.
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.
From-SVN: r161862
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index ccafa4d..87603e7 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -5596,7 +5596,7 @@ replace_by_duplicate_decl (tree *tp, struct pointer_map_t *vars_map, if (SSA_VAR_P (t)) { new_t = copy_var_decl (t, DECL_NAME (t), TREE_TYPE (t)); - f->local_decls = tree_cons (NULL_TREE, new_t, f->local_decls); + add_local_decl (f, new_t); } else { @@ -6316,7 +6316,7 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb, void dump_function_to_file (tree fn, FILE *file, int flags) { - tree arg, vars, var; + tree arg, var; struct function *dsf; bool ignore_topmost_bind = false, any_var = false; basic_block bb; @@ -6356,15 +6356,14 @@ dump_function_to_file (tree fn, FILE *file, int flags) /* When GIMPLE is lowered, the variables are no longer available in BIND_EXPRs, so display them separately. */ - if (cfun && cfun->decl == fn && cfun->local_decls) + if (cfun && cfun->decl == fn && !VEC_empty (tree, cfun->local_decls)) { + unsigned ix; ignore_topmost_bind = true; fprintf (file, "{\n"); - for (vars = cfun->local_decls; vars; vars = TREE_CHAIN (vars)) + FOR_EACH_LOCAL_DECL (cfun, ix, var) { - var = TREE_VALUE (vars); - print_generic_decl (file, var, flags); if (flags & TDF_VERBOSE) print_node (file, "", var, 4); |