Check Attribute::NoInline.
authorDevang Patel <dpatel@apple.com>
Wed, 5 Nov 2008 01:37:05 +0000 (01:37 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 5 Nov 2008 01:37:05 +0000 (01:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58742 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/InlineCost.cpp

index b85a45590cb60230979332707ef3390ed9ae40b7..29d4f79732557d52577e95951371ed99283139ff 100644 (file)
@@ -182,11 +182,9 @@ InlineCost InlineCostAnalyzer::getInlineCost(CallSite CS,
       // FIXME: We allow link-once linkage since in practice all versions of
       // the function have the same body (C++ ODR) - but the LLVM definition
       // of LinkOnceLinkage doesn't require this.
-      (Callee->mayBeOverridden() && !Callee->hasLinkOnceLinkage()
-       ) ||
-
+      (Callee->mayBeOverridden() && !Callee->hasLinkOnceLinkage()) ||
       // Don't inline functions marked noinline.
-      NeverInline.count(Callee))
+      Callee->hasFnAttr(Attribute::NoInline) || NeverInline.count(Callee))
     return llvm::InlineCost::getNever();
 
   // InlineCost - This value measures how good of an inline candidate this call