* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127643
138bc75d-0d04-0410-961f-
82ee72b054a4
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 ...
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
#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
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 *);
#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);
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. */
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
/* 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);
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, \
}
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. */
{
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);
};
/* 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,
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;
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
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
}
}
+/* 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
*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;
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);
\f
/* In stmt.c */