langhooks-def.h (lhd_tree_inlining_auto_var_in_fn_p): Remove.
authorRichard Guenther <rguenther@suse.de>
Mon, 20 Aug 2007 11:28:14 +0000 (11:28 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 20 Aug 2007 11:28:14 +0000 (11:28 +0000)
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

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 2e090c1056bd457c481be10830e36f4d635a58b1..aa6c0084e2e770a8f606ac3f9fd4c3e72e66f23e 100644 (file)
@@ -1,3 +1,20 @@
+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.
index d9dbda9e988c958565d7fe1a81f8fd644674368a..432b5b2e5e6067c80124006c4890b98d382fe4cd 100644 (file)
@@ -1,3 +1,12 @@
+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):
index 9cff31b92ce4d87ab9c8a6850dab5b0c6f2a38ef..e67b847f4216142fd765ce816593a2965b34dbdf 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 c35bb9518b96408bc14891cd30574a7d4ee4d707..c715cd7a03592c5295fdc28a0471fb55a51fd87c 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 a890ee1292e69b0ce5350d69b30857e6419b16a6..ef67bc5fd97f52dadd6260c06f6cdb9cbf562d3c 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 3edf39f263ef30456a9f06d6b8928f8ec41d9c80..9c80fba30d60201e9fe11f0e46c7dce2c4a1e2df 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 074e615ba08cff3dfb33306b477b1987655f3b57..862ea183686b71a3988d5a21cdac02942871cc74 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 8260b3135e3193df2ad0bad61e911f66c0066798..2a731b7cba96e0b19f9b85f684daed62bd0479f3 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 299ec8f838ad4b59ef62ae964bc23f96cabf7f6b..0032e5558958074621cacc1d84bd1a57170b67db 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 c078166bd168eaa313ea477f9249b6cc851223bd..80a18837dded2c43d523ae2f0fc57b4fc45043b1 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 61f17de706deaccbfb443aff2af252e84a306b40..ce4ee5d263f0a314bb8ef271575ed62d04c64ffd 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 b8e960b4640a8396381a7f9da808fdfb4f11a2eb..18cef504e72128a8f0e9a5e1c02093a110f9c132 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 */