[llvm-branch-commits] [llvm-gcc-branch] r95674 - in /llvm-gcc-4.2/branches/Apple/Hermes/gcc: ada/utils.c c-decl.c cp/decl.c cp/method.c cp/optimize.c cp/pt.c llvm-convert.cpp tree.h

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Feb 9 10:04:46 PST 2010


Author: stoklund
Date: Tue Feb  9 12:04:45 2010
New Revision: 95674

URL: http://llvm.org/viewvc/llvm-project?rev=95674&view=rev
Log:
Merge r95625 inlinehint attribute

Modified:
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/ada/utils.c
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/c-decl.c
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/decl.c
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/method.c
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/optimize.c
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/pt.c
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/llvm-convert.cpp
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/tree.h

Modified: llvm-gcc-4.2/branches/Apple/Hermes/gcc/ada/utils.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/ada/utils.c?rev=95674&r1=95673&r2=95674&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/ada/utils.c (original)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/ada/utils.c Tue Feb  9 12:04:45 2010
@@ -1772,6 +1772,10 @@
 
   if (inline_flag)
     DECL_DECLARED_INLINE_P (subprog_decl) = 1;
+  /* LLVM LOCAL begin inlinehint attribute */
+  if (inline_flag)
+    DECL_EXPLICIT_INLINE_P (subprog_decl) = 1;
+  /* LLVM LOCAL end inlinehint attribute */
 
   if (asm_name)
     SET_DECL_ASSEMBLER_NAME (subprog_decl, asm_name);

Modified: llvm-gcc-4.2/branches/Apple/Hermes/gcc/c-decl.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/c-decl.c?rev=95674&r1=95673&r2=95674&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/c-decl.c (original)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/c-decl.c Tue Feb  9 12:04:45 2010
@@ -1919,6 +1919,11 @@
 	      || DECL_DECLARED_INLINE_P (olddecl))
 	    DECL_DECLARED_INLINE_P (newdecl) = 1;
 
+	  /* LLVM LOCAL begin inlinehint attribute */
+	  if (DECL_EXPLICIT_INLINE_P (olddecl))
+	    DECL_EXPLICIT_INLINE_P (newdecl) = 1;
+	  /* LLVM LOCAL end inlinehint attribute */
+
 	  DECL_UNINLINABLE (newdecl) = DECL_UNINLINABLE (olddecl)
 	    = (DECL_UNINLINABLE (newdecl) || DECL_UNINLINABLE (olddecl));
 	}
@@ -5492,6 +5497,9 @@
 	  {
 	    /* Record that the function is declared `inline'.  */
 	    DECL_DECLARED_INLINE_P (decl) = 1;
+	    /* LLVM LOCAL begin inlinehint attribute */
+	    DECL_EXPLICIT_INLINE_P (decl) = 1;
+	    /* LLVM LOCAL end inlinehint attribute */
 
 	    /* Do not mark bare declarations as DECL_INLINE.  Doing so
 	       in the presence of multiple declarations can result in

Modified: llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/decl.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/decl.c?rev=95674&r1=95673&r2=95674&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/decl.c (original)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/decl.c Tue Feb  9 12:04:45 2010
@@ -1904,6 +1904,10 @@
 
 	  DECL_DECLARED_INLINE_P (newdecl) |= DECL_DECLARED_INLINE_P (olddecl);
 
+	  /* LLVM LOCAL begin inlinehint attribute */
+	  DECL_EXPLICIT_INLINE_P (newdecl) |= DECL_EXPLICIT_INLINE_P (olddecl);
+	  /* LLVM LOCAL end inlinehint attribute */
+
 	  /* If either decl says `inline', this fn is inline, unless
 	     its definition was passed already.  */
 	  if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == NULL_TREE)
@@ -6813,6 +6817,11 @@
   /* If the declaration was declared inline, mark it as such.  */
   if (inlinep)
     DECL_DECLARED_INLINE_P (decl) = 1;
+  /* LLVM LOCAL begin inlinehint attribute */
+  if (inlinep)
+    DECL_EXPLICIT_INLINE_P (decl) = 1;
+  /* LLVM LOCAL end inlinehint attribute */
+
   /* We inline functions that are explicitly declared inline, or, when
      the user explicitly asks us to, all functions.  */
   if (DECL_DECLARED_INLINE_P (decl)

Modified: llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/method.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/method.c?rev=95674&r1=95673&r2=95674&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/method.c (original)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/method.c Tue Feb  9 12:04:45 2010
@@ -159,6 +159,9 @@
   DECL_PENDING_INLINE_P (thunk) = 0;
   DECL_INLINE (thunk) = 0;
   DECL_DECLARED_INLINE_P (thunk) = 0;
+  /* LLVM LOCAL begin inlinehint attribute */
+  DECL_EXPLICIT_INLINE_P (thunk) = 0;
+  /* LLVM LOCAL end inlinehint attribute */
   /* Nor has it been deferred.  */
   DECL_DEFERRED_FN (thunk) = 0;
   /* Nor is it a template instantiation.  */
@@ -283,6 +286,9 @@
   DECL_PENDING_INLINE_P (alias) = 0;
   DECL_INLINE (alias) = 0;
   DECL_DECLARED_INLINE_P (alias) = 0;
+  /* LLVM LOCAL begin inlinehint attribute */
+  DECL_EXPLICIT_INLINE_P (alias) = 0;
+  /* LLVM LOCAL end inlinehint attribute */
   DECL_DEFERRED_FN (alias) = 0;
   DECL_USE_TEMPLATE (alias) = 0;
   DECL_TEMPLATE_INSTANTIATED (alias) = 0;

Modified: llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/optimize.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/optimize.c?rev=95674&r1=95673&r2=95674&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/optimize.c (original)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/optimize.c Tue Feb  9 12:04:45 2010
@@ -397,6 +397,9 @@
       DECL_SOURCE_LOCATION (clone) = DECL_SOURCE_LOCATION (fn);
       DECL_INLINE (clone) = DECL_INLINE (fn);
       DECL_DECLARED_INLINE_P (clone) = DECL_DECLARED_INLINE_P (fn);
+      /* LLVM LOCAL begin inlinehint attribute */
+      DECL_EXPLICIT_INLINE_P (clone) = DECL_EXPLICIT_INLINE_P (fn);
+      /* LLVM LOCAL end inlinehint attribute */
       DECL_COMDAT (clone) = DECL_COMDAT (fn);
       DECL_WEAK (clone) = DECL_WEAK (fn);
       DECL_ONE_ONLY (clone) = DECL_ONE_ONLY (fn);

Modified: llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/pt.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/pt.c?rev=95674&r1=95673&r2=95674&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/pt.c (original)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/pt.c Tue Feb  9 12:04:45 2010
@@ -12047,6 +12047,10 @@
       if (DECL_DECLARED_INLINE_P (code_pattern)
 	  && !DECL_DECLARED_INLINE_P (decl))
 	DECL_DECLARED_INLINE_P (decl) = 1;
+      /* LLVM LOCAL begin inlinehint attribute */
+      if (DECL_EXPLICIT_INLINE_P (code_pattern))
+	DECL_EXPLICIT_INLINE_P (decl) = 1;
+      /* LLVM LOCAL end inlinehint attribute */
       if (DECL_INLINE (code_pattern) && !DECL_INLINE (decl))
 	DECL_INLINE (decl) = 1;
     }

Modified: llvm-gcc-4.2/branches/Apple/Hermes/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/llvm-convert.cpp?rev=95674&r1=95673&r2=95674&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/llvm-convert.cpp Tue Feb  9 12:04:45 2010
@@ -578,6 +578,10 @@
   if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (FnDecl)))
     Fn->addFnAttr(Attribute::AlwaysInline);
 
+  // Pass inline keyword to optimizer.
+  if (DECL_EXPLICIT_INLINE_P (FnDecl))
+    Fn->addFnAttr(Attribute::InlineHint);
+
   if (optimize_size)
     Fn->addFnAttr(Attribute::OptimizeForSize);
 

Modified: llvm-gcc-4.2/branches/Apple/Hermes/gcc/tree.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/tree.h?rev=95674&r1=95673&r2=95674&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/tree.h (original)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/tree.h Tue Feb  9 12:04:45 2010
@@ -3271,6 +3271,15 @@
 #define DECL_DECLARED_INLINE_P(NODE) \
   (FUNCTION_DECL_CHECK (NODE)->function_decl.declared_inline_flag)
 
+/* LLVM LOCAL begin inlinehint attribute */
+/* Nonzero in a FUNCTION_DECL means that this function was explicitly declared
+   inline via the `inline' keyword.  This flag controls the inlinehint attribute
+   passed to the LLVM optimizer.  */
+#define DECL_EXPLICIT_INLINE_P(NODE) \
+  (FUNCTION_DECL_CHECK (NODE)->function_decl.explicit_inline_flag)
+/* LLVM LOCAL end inlinehint attribute */
+
+
 /* For FUNCTION_DECL, this holds a pointer to a structure ("struct function")
    that describes the status of this function.  */
 #define DECL_STRUCT_FUNCTION(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.f)
@@ -3318,6 +3327,9 @@
   unsigned no_instrument_function_entry_exit : 1;
   unsigned no_limit_stack : 1;
   ENUM_BITFIELD(built_in_class) built_in_class : 2;
+  /* LLVM LOCAL begin inlinehint attribute */
+  unsigned explicit_inline_flag : 1;
+  /* LLVM LOCAL end inlinehint attribute */
 
   /* APPLE LOCAL DECL_ESTIMATED_INSNS */
   HOST_WIDE_INT estimated_insns;





More information about the llvm-branch-commits mailing list