2007-08-20 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Aug 2007 11:28:14 +0000 (11:28 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Aug 2007 11:28:14 +0000 (11:28 +0000)
* 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

12 files changed:
gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/cp-objcp-common.h
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/tree.c
gcc/langhooks-def.h
gcc/langhooks.c
gcc/langhooks.h
gcc/tree-inline.c
gcc/tree.c
gcc/tree.h

index 2e090c1..aa6c008 100644 (file)
@@ -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 ...
index d9dbda9..432b5b2 100644 (file)
@@ -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
index 9cff31b..e67b847 100644 (file)
@@ -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
index c35bb95..c715cd7 100644 (file)
@@ -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);
index a890ee1..ef67bc5 100644 (file)
@@ -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.  */
 
index 3edf39f..9c80fba 100644 (file)
@@ -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
index 074e615..862ea18 100644 (file)
@@ -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, \
 }
 
index 8260b31..2a731b7 100644 (file)
@@ -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.  */
index 299ec8f..0032e55 100644 (file)
@@ -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);
 };
 
index c078166..80a1883 100644 (file)
@@ -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
index 61f17de..ce4ee5d 100644 (file)
@@ -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;
index b8e960b..18cef50 100644 (file)
@@ -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);
 \f
 /* In stmt.c */