c-objc-common.c (c_disregard_inline_limits): Remove.
authorRichard Guenther <rguenther@suse.de>
Mon, 20 Aug 2007 11:37:08 +0000 (11:37 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 20 Aug 2007 11:37:08 +0000 (11:37 +0000)
2007-08-20  Richard Guenther  <rguenther@suse.de>

* c-objc-common.c (c_disregard_inline_limits): Remove.
* c-objc-common.h (c_disregard_inline_limits): Likewise.
* cgraphunit.c (cgraph_process_new_functions): Call
disregard_inline_limits_p.
(cgraph_preserve_function_body_p): Likewise.
* ipa-inline.c (compute_inline_parameters): Likewise.
* langhooks-def.h (lhd_tree_inlining_disregard_inline_limits):
Remove.
(LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS): Remove.
(LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove initializer for
disregard_inline_limits langhook.
* langhooks.c (lhd_tree_inlining_disregard_inline_limits):
Remove.
* langhooks.h (lang_hooks_for_tree_inlining): Remove
disregard_inline_limits langhook.
* tree-inline.c (disregard_inline_limits_p): New function.
* tree-inline.h (disregard_inline_limits_p): Declare.

From-SVN: r127644

gcc/ChangeLog
gcc/c-objc-common.c
gcc/c-objc-common.h
gcc/cgraphunit.c
gcc/ipa-inline.c
gcc/langhooks-def.h
gcc/langhooks.c
gcc/langhooks.h
gcc/tree-inline.c
gcc/tree-inline.h

index aa6c0084e2e770a8f606ac3f9fd4c3e72e66f23e..4ce1dd6c650c2d063db3cbbb425151c293518a04 100644 (file)
@@ -1,3 +1,23 @@
+2007-08-20  Richard Guenther  <rguenther@suse.de>
+
+       * c-objc-common.c (c_disregard_inline_limits): Remove.
+       * c-objc-common.h (c_disregard_inline_limits): Likewise.
+       * cgraphunit.c (cgraph_process_new_functions): Call
+       disregard_inline_limits_p.
+       (cgraph_preserve_function_body_p): Likewise.
+       * ipa-inline.c (compute_inline_parameters): Likewise.
+       * langhooks-def.h (lhd_tree_inlining_disregard_inline_limits):
+       Remove.
+       (LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS): Remove.
+       (LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove initializer for
+       disregard_inline_limits langhook.
+       * langhooks.c (lhd_tree_inlining_disregard_inline_limits):
+       Remove.
+       * langhooks.h (lang_hooks_for_tree_inlining): Remove
+       disregard_inline_limits langhook.
+       * tree-inline.c (disregard_inline_limits_p): New function.
+       * tree-inline.h (disregard_inline_limits_p): Declare.
+
 2007-08-20  Richard Guenther  <rguenther@suse.de>
 
        * langhooks-def.h (lhd_tree_inlining_auto_var_in_fn_p): Remove.
index 58c748cde1d37d70dbf996344641f46ca68b2833..efd576fd5be079cb6f71eb8e4b65127cddafbd04 100644 (file)
@@ -50,20 +50,6 @@ c_missing_noreturn_ok_p (tree decl)
   return flag_hosted && MAIN_NAME_P (DECL_ASSEMBLER_NAME (decl));
 }
 
-/* We want to inline `extern inline' functions even if this would
-   violate inlining limits.  Some glibc and linux constructs depend on
-   such functions always being inlined when optimizing.  */
-
-int
-c_disregard_inline_limits (const_tree fn)
-{
-  if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
-    return 1;
-
-  return (!flag_really_no_inline && DECL_DECLARED_INLINE_P (fn)
-         && DECL_EXTERNAL (fn));
-}
-
 int
 c_cannot_inline_tree_fn (tree *fnp)
 {
index b8355d2608d53c5efc0571f7d1bad600f8b108b1..66b25b369236ee932b0a2c95f024d612d4ca227a 100644 (file)
@@ -85,9 +85,6 @@ extern void c_initialize_diagnostics (diagnostic_context *);
 #undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN
 #define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
   c_cannot_inline_tree_fn
-#undef LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS
-#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \
-  c_disregard_inline_limits
 #undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN
 #define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN c_dump_tree
 
index f810c278b665c6594b25bf5f8c2e4b556a66bca8..dddc093b5b35fd12d7221f88714721f0b7e3ded2 100644 (file)
@@ -381,7 +381,7 @@ cgraph_process_new_functions (void)
          node->local.self_insns = estimate_num_insns (fndecl,
                                                       &eni_inlining_weights);
          node->local.disregard_inline_limits
-           |= lang_hooks.tree_inlining.disregard_inline_limits (fndecl);
+           |= disregard_inline_limits_p (fndecl);
          /* Inlining characteristics are maintained by the
             cgraph_mark_inline.  */
          node->global.insns = node->local.self_insns;
@@ -1252,7 +1252,7 @@ cgraph_preserve_function_body_p (tree decl)
   struct cgraph_node *node;
   if (!cgraph_global_info_ready)
     return (flag_really_no_inline
-           ? lang_hooks.tree_inlining.disregard_inline_limits (decl)
+           ? disregard_inline_limits_p (decl)
            : DECL_INLINE (decl));
   /* Look if there is any clone around.  */
   for (node = cgraph_node (decl); node; node = node->next_clone)
index 21b894f7f5342eda3961b2d65c455b0116235d44..f74ebf8c9f14af6fae79a2489bb7d2b3b9a26f50 100644 (file)
@@ -1529,7 +1529,7 @@ compute_inline_parameters (void)
                                               &eni_inlining_weights);
   if (node->local.inlinable && !node->local.disregard_inline_limits)
     node->local.disregard_inline_limits
-      = lang_hooks.tree_inlining.disregard_inline_limits (current_function_decl);
+      = disregard_inline_limits_p (current_function_decl);
   if (flag_really_no_inline && !node->local.disregard_inline_limits)
     node->local.inlinable = 0;
   /* Inlining characteristics are maintained by the cgraph_mark_inline.  */
index 862ea183686b71a3988d5a21cdac02942871cc74..05d8f4b74ba079ec79f6ddff66bd35a1ea6bca1a 100644 (file)
@@ -69,7 +69,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 void lhd_initialize_diagnostics (struct diagnostic_context *);
 extern tree lhd_callgraph_analyze_expr (tree *, int *, tree);
 
@@ -134,14 +133,11 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *,
 /* Tree inlining hooks.  */
 #define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
   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_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_VAR_MOD_TYPE_P, \
 }
 
index 2a731b7cba96e0b19f9b85f684daed62bd0479f3..56680c94082c75b5ffb0388465395c269d955265 100644 (file)
@@ -290,19 +290,6 @@ lhd_tree_inlining_cannot_inline_tree_fn (tree *fnp)
   return 0;
 }
 
-/* lang_hooks.tree_inlining.disregard_inline_limits is called to
-   determine whether a function should be considered for inlining even
-   if it would exceed inlining limits.  */
-
-int
-lhd_tree_inlining_disregard_inline_limits (const_tree fn)
-{
-  if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
-    return 1;
-
-  return 0;
-}
-
 /* 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 0032e5558958074621cacc1d84bd1a57170b67db..a25371c05eef1d33b5656068bcd225c632f39fcf 100644 (file)
@@ -36,7 +36,6 @@ typedef void (*lang_print_tree_hook) (FILE *, tree, int indent);
 struct lang_hooks_for_tree_inlining
 {
   int (*cannot_inline_tree_fn) (tree *);
-  int (*disregard_inline_limits) (const_tree);
   bool (*var_mod_type_p) (tree, tree);
 };
 
index 80a18837dded2c43d523ae2f0fc57b4fc45043b1..16198385496bc13422bee23bce8606b03b86a6d6 100644 (file)
@@ -1914,6 +1914,15 @@ inlinable_function_p (tree fn)
   return inlinable;
 }
 
+/* Return true if we shall disregard inlining limits for the function
+   FN during inlining.  */
+
+bool
+disregard_inline_limits_p (tree fn)
+{
+  return lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL_TREE;
+}
+
 /* Estimate the cost of a memory move.  Use machine dependent
    word size and take possible memcpy call into account.  */
 
index 200a9a68fc3664957a8b6d188728165b190cb883..05d921a2b6f79a453df504043bae468f4d50e1f8 100644 (file)
@@ -130,6 +130,7 @@ extern void insert_decl_map (copy_body_data *, tree, tree);
 
 unsigned int optimize_inline_calls (tree);
 bool tree_inlinable_function_p (tree);
+bool disregard_inline_limits_p (tree);
 tree copy_tree_r (tree *, int *, void *);
 void clone_body (tree, tree, void *);
 void save_body (tree, tree *, tree *);