diff options
author | Richard Guenther <rguenther@suse.de> | 2007-08-20 11:28:14 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-08-20 11:28:14 +0000 |
commit | 50886bf1f9143bd97180043ceaddde5061d43e78 (patch) | |
tree | 7a357b039785ec8b4512742e9512b49128d47deb /gcc | |
parent | 145881069e8d5a19e131b5c1922bdb2e27b708da (diff) | |
download | gcc-50886bf1f9143bd97180043ceaddde5061d43e78.zip gcc-50886bf1f9143bd97180043ceaddde5061d43e78.tar.gz gcc-50886bf1f9143bd97180043ceaddde5061d43e78.tar.bz2 |
langhooks-def.h (lhd_tree_inlining_auto_var_in_fn_p): Remove.
2007-08-20 Richard Guenther <rguenther@suse.de>
* langhooks-def.h (lhd_tree_inlining_auto_var_in_fn_p): Remove.
(LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P): Likewise.
(LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove initializer for
auto_var_in_fn_p langhook.
* langhooks.c (lhd_tree_inlining_auto_var_in_fn_p): Rename and
move ...
* tree.c (auto_var_in_fn_p): ... here.
(find_var_from_fn): Call auto_var_in_fn_p directly.
* langhooks.h (lang_hooks_for_tree_inlining): Remove
auto_var_in_fn_p langhook.
* tree-inline.c (remap_decls): Call auto_var_in_fn_p directly.
(copy_body_r): Likewise.
(self_inlining_addr_expr): Likewise.
* tree.h (auto_var_in_fn_p): Declare.
cp/
* cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
Remove.
* cp-tree.h (cp_auto_var_in_fn_p): Remove.
(nonstatic_local_decl_p): Likewise.
* tree.c (cp_auto_var_in_fn_p): Remove.
* decl.c (nonstatic_local_decl_p): Remove.
From-SVN: r127643
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 17 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/cp-objcp-common.h | 3 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/decl.c | 12 | ||||
-rw-r--r-- | gcc/cp/tree.c | 10 | ||||
-rw-r--r-- | gcc/langhooks-def.h | 4 | ||||
-rw-r--r-- | gcc/langhooks.c | 13 | ||||
-rw-r--r-- | gcc/langhooks.h | 1 | ||||
-rw-r--r-- | gcc/tree-inline.c | 9 | ||||
-rw-r--r-- | gcc/tree.c | 15 | ||||
-rw-r--r-- | gcc/tree.h | 1 |
12 files changed, 45 insertions, 51 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2e090c1..aa6c008 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,22 @@ 2007-08-20 Richard Guenther <rguenther@suse.de> + * langhooks-def.h (lhd_tree_inlining_auto_var_in_fn_p): Remove. + (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P): Likewise. + (LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove initializer for + auto_var_in_fn_p langhook. + * langhooks.c (lhd_tree_inlining_auto_var_in_fn_p): Rename and + move ... + * tree.c (auto_var_in_fn_p): ... here. + (find_var_from_fn): Call auto_var_in_fn_p directly. + * langhooks.h (lang_hooks_for_tree_inlining): Remove + auto_var_in_fn_p langhook. + * tree-inline.c (remap_decls): Call auto_var_in_fn_p directly. + (copy_body_r): Likewise. + (self_inlining_addr_expr): Likewise. + * tree.h (auto_var_in_fn_p): Declare. + +2007-08-20 Richard Guenther <rguenther@suse.de> + * tree.c (WALK_SUBTREE): Call walk_tree_1. (walk_type_fields): Take lh parameter. (walk_tree): Rename to ... diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d9dbda9..432b5b2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,14 @@ 2007-08-20 Richard Guenther <rguenther@suse.de> + * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P): + Remove. + * cp-tree.h (cp_auto_var_in_fn_p): Remove. + (nonstatic_local_decl_p): Likewise. + * tree.c (cp_auto_var_in_fn_p): Remove. + * decl.c (nonstatic_local_decl_p): Remove. + +2007-08-20 Richard Guenther <rguenther@suse.de> + * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): Remove define. * tree.h (cp_walk_tree): New define to walk_tree_1 with diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h index 9cff31b..e67b847 100644 --- a/gcc/cp/cp-objcp-common.h +++ b/gcc/cp/cp-objcp-common.h @@ -107,9 +107,6 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t, #undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN #define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \ cp_cannot_inline_tree_fn -#undef LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P -#define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \ - cp_auto_var_in_fn_p #undef LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P #define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P cp_var_mod_type_p #undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index c35bb95..c715cd7 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4251,7 +4251,6 @@ extern tree maybe_push_decl (tree); extern tree force_target_expr (tree, tree); extern tree build_target_expr_with_type (tree, tree); extern int local_variable_p (const_tree); -extern int nonstatic_local_decl_p (const_tree); extern tree register_dtor_fn (tree); extern tmpl_spec_kind current_tmpl_spec_kind (int); extern tree cp_fname_init (const char *, tree *); @@ -4741,7 +4740,6 @@ extern tree cp_walk_subtrees (tree*, int*, walk_tree_fn, #define cp_walk_tree_without_duplicates(a,b,c) \ walk_tree_without_duplicates_1 (a, b, c, cp_walk_subtrees) extern int cp_cannot_inline_tree_fn (tree*); -extern int cp_auto_var_in_fn_p (const_tree, const_tree); extern tree fold_if_not_in_template (tree); extern tree rvalue (tree); extern tree convert_bitfield_to_declared_type (tree); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a890ee1..ef67bc5 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8976,18 +8976,6 @@ local_variable_p (const_tree t) return 0; } -/* Returns nonzero if T is an automatic local variable or a label. - (These are the declarations that need to be remapped when the code - containing them is duplicated.) */ - -int -nonstatic_local_decl_p (const_tree t) -{ - return ((local_variable_p (t) && !TREE_STATIC (t)) - || TREE_CODE (t) == LABEL_DECL - || TREE_CODE (t) == RESULT_DECL); -} - /* Like local_variable_p, but suitable for use as a tree-walking function. */ diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 3edf39f..9c80fba 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2450,16 +2450,6 @@ cp_cannot_inline_tree_fn (tree* fnp) return 0; } -/* Determine whether VAR is a declaration of an automatic variable in - function FN. */ - -int -cp_auto_var_in_fn_p (const_tree var, const_tree fn) -{ - return (DECL_P (var) && DECL_CONTEXT (var) == fn - && nonstatic_local_decl_p (var)); -} - /* Like save_expr, but for C++. */ tree diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index 074e615..862ea18 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -70,7 +70,6 @@ extern tree lhd_builtin_function (tree decl); /* Declarations of default tree inlining hooks. */ extern int lhd_tree_inlining_cannot_inline_tree_fn (tree *); extern int lhd_tree_inlining_disregard_inline_limits (const_tree); -extern int lhd_tree_inlining_auto_var_in_fn_p (const_tree, const_tree); extern void lhd_initialize_diagnostics (struct diagnostic_context *); extern tree lhd_callgraph_analyze_expr (tree *, int *, tree); @@ -137,15 +136,12 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *, lhd_tree_inlining_cannot_inline_tree_fn #define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \ lhd_tree_inlining_disregard_inline_limits -#define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \ - lhd_tree_inlining_auto_var_in_fn_p #define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P \ hook_bool_tree_tree_false #define LANG_HOOKS_TREE_INLINING_INITIALIZER { \ LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, \ LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS, \ - LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P, \ LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P, \ } diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 8260b31..2a731b7 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -303,19 +303,6 @@ lhd_tree_inlining_disregard_inline_limits (const_tree fn) return 0; } -/* lang_hooks.tree_inlining.auto_var_in_fn_p is called to determine - whether VT is an automatic variable defined in function FT. */ - -int -lhd_tree_inlining_auto_var_in_fn_p (const_tree var, const_tree fn) -{ - return (DECL_P (var) && DECL_CONTEXT (var) == fn - && (((TREE_CODE (var) == VAR_DECL || TREE_CODE (var) == PARM_DECL) - && ! TREE_STATIC (var)) - || TREE_CODE (var) == LABEL_DECL - || TREE_CODE (var) == RESULT_DECL)); -} - /* lang_hooks.tree_dump.dump_tree: Dump language-specific parts of tree nodes. Returns nonzero if it does not want the usual dumping of the second argument. */ diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 299ec8f..0032e555 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -37,7 +37,6 @@ struct lang_hooks_for_tree_inlining { int (*cannot_inline_tree_fn) (tree *); int (*disregard_inline_limits) (const_tree); - int (*auto_var_in_fn_p) (const_tree, const_tree); bool (*var_mod_type_p) (tree, tree); }; diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index c078166..80a1883 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -428,7 +428,7 @@ remap_decls (tree decls, copy_body_data *id) /* We can not chain the local static declarations into the unexpanded_var_list as we can't duplicate them or break one decl rule. Go ahead and link them into unexpanded_var_list. */ - if (!lang_hooks.tree_inlining.auto_var_in_fn_p (old_var, id->src_fn) + if (!auto_var_in_fn_p (old_var, id->src_fn) && !DECL_EXTERNAL (old_var)) { cfun->unexpanded_var_list = tree_cons (NULL_TREE, old_var, @@ -586,7 +586,7 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data) variables. We don't want to copy static variables; there's only one of those, no matter how many times we inline the containing function. Similarly for globals from an outer function. */ - else if (lang_hooks.tree_inlining.auto_var_in_fn_p (*tp, fn)) + else if (auto_var_in_fn_p (*tp, fn)) { tree new_decl; @@ -641,8 +641,7 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data) discarding. */ if (TREE_CODE (*tp) == GIMPLE_MODIFY_STMT && GIMPLE_STMT_OPERAND (*tp, 0) == GIMPLE_STMT_OPERAND (*tp, 1) - && (lang_hooks.tree_inlining.auto_var_in_fn_p - (GIMPLE_STMT_OPERAND (*tp, 0), fn))) + && (auto_var_in_fn_p (GIMPLE_STMT_OPERAND (*tp, 0), fn))) { /* Some assignments VAR = VAR; don't generate any rtl code and thus don't count as variable modification. Avoid @@ -1268,7 +1267,7 @@ self_inlining_addr_expr (tree value, tree fn) var = get_base_address (TREE_OPERAND (value, 0)); - return var && lang_hooks.tree_inlining.auto_var_in_fn_p (var, fn); + return var && auto_var_in_fn_p (var, fn); } static void @@ -6354,6 +6354,19 @@ get_type_static_bounds (const_tree type, mpz_t min, mpz_t max) } } +/* auto_var_in_fn_p is called to determine whether VAR is an automatic + variable defined in function FN. */ + +bool +auto_var_in_fn_p (tree var, tree fn) +{ + return (DECL_P (var) && DECL_CONTEXT (var) == fn + && (((TREE_CODE (var) == VAR_DECL || TREE_CODE (var) == PARM_DECL) + && ! TREE_STATIC (var)) + || TREE_CODE (var) == LABEL_DECL + || TREE_CODE (var) == RESULT_DECL)); +} + /* Subprogram of following function. Called by walk_tree. Return *TP if it is an automatic variable or parameter of the @@ -6368,7 +6381,7 @@ find_var_from_fn (tree *tp, int *walk_subtrees, void *data) *walk_subtrees = 0; else if (DECL_P (*tp) - && lang_hooks.tree_inlining.auto_var_in_fn_p (*tp, fn)) + && auto_var_in_fn_p (*tp, fn)) return *tp; return NULL_TREE; @@ -4610,6 +4610,7 @@ extern bool empty_body_p (tree); extern tree call_expr_arg (tree, int); extern tree *call_expr_argp (tree, int); extern tree call_expr_arglist (tree); +extern bool auto_var_in_fn_p (tree, tree); /* In stmt.c */ |