]> gcc.gnu.org Git - gcc.git/commitdiff
c-objc-common.c: Include target.h.
authorRichard Henderson <rth@redhat.com>
Sat, 31 Aug 2002 02:29:20 +0000 (19:29 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 31 Aug 2002 02:29:20 +0000 (19:29 -0700)
        * c-objc-common.c: Include target.h.
        (c_cannot_inline_tree_fn): Don't auto-inline functions that
        don't bind locally.  Factor setting DECL_UNINLINABLE.
        * Makefile.in (c-objc-common.o): Update.

From-SVN: r56691

gcc/ChangeLog
gcc/Makefile.in
gcc/c-objc-common.c

index a1aaed02e1bfdf785f4dd139298f4f6210d81c36..c47b260ead28142794bd8082bc5947e2a483e9df 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-30  Richard Henderson  <rth@redhat.com>
+
+       * c-objc-common.c: Include target.h.
+       (c_cannot_inline_tree_fn): Don't auto-inline functions that
+       don't bind locally.  Factor setting DECL_UNINLINABLE.
+       * Makefile.in (c-objc-common.o): Update.
+
 2002-08-30  Janis Johnson  <janis187@us.ibm.com>
 
        * doc/install.texi (Configuration, Building): Fix a typo and
index dfdc49fa54d446ad59543b54f0728766afb2080f..a02fdc9db271e87725e9c92577379f3ebf4f83d3 100644 (file)
@@ -1190,7 +1190,7 @@ c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) \
 c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
     $(C_TREE_H) $(RTL_H) insn-config.h integrate.h $(EXPR_H) $(C_TREE_H) \
     flags.h toplev.h tree-inline.h diagnostic.h integrate.h $(VARRAY_H) \
-    langhooks.h $(GGC_H) gt-c-objc-common.h
+    langhooks.h $(GGC_H) gt-c-objc-common.h $(TARGET_H)
 c-aux-info.o : c-aux-info.c  $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
     flags.h toplev.h
 c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h toplev.h \
index 939c5345a7833c39e7c25bcdbf598dddca3abb75..30c85148db7d3a8f5e31b015d995d29c8b1a32da 100644 (file)
@@ -34,6 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "varray.h"
 #include "ggc.h"
 #include "langhooks.h"
+#include "target.h"
 
 static bool c_tree_printer PARAMS ((output_buffer *, text_info *));
 static tree inline_forbidden_p PARAMS ((tree *, int *, void *));
@@ -150,11 +151,13 @@ c_cannot_inline_tree_fn (fnp)
       && lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL)
     return 1;
 
+  /* Don't auto-inline anything that might not be bound within 
+     this unit of translation.  */
+  if (!DECL_DECLARED_INLINE_P (fn) && !(*targetm.binds_local_p) (fn))
+    goto cannot_inline;
+
   if (! function_attribute_inlinable_p (fn))
-    {
-      DECL_UNINLINABLE (fn) = 1;
-      return 1;
-    }
+    goto cannot_inline;
 
   /* If a function has pending sizes, we must not defer its
      compilation, and we can't inline it as a tree.  */
@@ -164,10 +167,7 @@ c_cannot_inline_tree_fn (fnp)
       put_pending_sizes (t);
 
       if (t)
-       {
-         DECL_UNINLINABLE (fn) = 1;
-         return 1;
-       }
+       goto cannot_inline;
     }
 
   if (DECL_CONTEXT (fn))
@@ -175,10 +175,7 @@ c_cannot_inline_tree_fn (fnp)
       /* If a nested function has pending sizes, we may have already
          saved them.  */
       if (DECL_LANG_SPECIFIC (fn)->pending_sizes)
-       {
-         DECL_UNINLINABLE (fn) = 1;
-         return 1;
-       }
+       goto cannot_inline;
     }
   else
     {
@@ -201,12 +198,13 @@ c_cannot_inline_tree_fn (fnp)
     }
     
   if (walk_tree (&DECL_SAVED_TREE (fn), inline_forbidden_p, fn, NULL))
-    {
-      DECL_UNINLINABLE (fn) = 1;
-      return 1;
-    }
+    goto cannot_inline;
 
   return 0;
+
+ cannot_inline:
+  DECL_UNINLINABLE (fn) = 1;
+  return 1;
 }
 
 /* Called from check_global_declarations.  */
This page took 0.10562 seconds and 5 git commands to generate.