OSDN Git Service

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127644 138bc75d-0d04-0410-961f-82ee72b054a4

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 aa6c008..4ce1dd6 100644 (file)
@@ -1,5 +1,25 @@
 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.
        (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P): Likewise.
        (LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove initializer for
index 58c748c..efd576f 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 b8355d2..66b25b3 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 f810c27..dddc093 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 21b894f..f74ebf8 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 862ea18..05d8f4b 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 2a731b7..56680c9 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 0032e55..a25371c 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 80a1883..1619838 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 200a9a6..05d921a 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 *);