[llvm-commits] [dragonegg] r97410 - /dragonegg/trunk/llvm-convert.cpp

Duncan Sands baldrick at free.fr
Sun Feb 28 11:45:07 PST 2010


Author: baldrick
Date: Sun Feb 28 13:45:07 2010
New Revision: 97410

URL: http://llvm.org/viewvc/llvm-project?rev=97410&view=rev
Log:
Port commit 95625 (stoklund) from llvm-gcc.  Adding DECL_EXPLICIT_INLINE_P
to mainline gcc is not feasible, so just use DECL_DECLARED_INLINE_P.  In any
case I don't see why functions the front-end considers to be good inlining
candidates should be treated any differently to functions the programmer
thinks are good inlining candidates.  The original commit message:
We only want cases where the inline keyword is given explicitly. The existing
DECL_DECLARED_INLINE_P flag is not sufficient for this because it is set for
certain implicitly defined methods as well as C++ methods defined as part of
the class definition.

Modified:
    dragonegg/trunk/llvm-convert.cpp

Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=97410&r1=97409&r2=97410&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Sun Feb 28 13:45:07 2010
@@ -673,6 +673,10 @@
   if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (FnDecl)))
     Fn->addFnAttr(Attribute::AlwaysInline);
 
+  // Pass inline keyword to optimizer.
+  if (DECL_DECLARED_INLINE_P(FnDecl))
+    Fn->addFnAttr(Attribute::InlineHint);
+
   if (optimize_size)
     Fn->addFnAttr(Attribute::OptimizeForSize);
 





More information about the llvm-commits mailing list