From adc6cbf5b502f1b58078455ab4fca66c7daac239 Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Mon, 18 Jun 2012 07:00:48 +0000 Subject: [MSExtensions] Add support for __forceinline. __forceinline is a combination of the inline keyword and __attribute__((always_inline)) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158653 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index e64a20403c..c72b8665f3 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -518,7 +518,7 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, F->addFnAttr(llvm::Attribute::NoInline); // (noinline wins over always_inline, and we can't specify both in IR) - if (D->hasAttr() && + if ((D->hasAttr() || D->hasAttr()) && !F->hasFnAttr(llvm::Attribute::NoInline)) F->addFnAttr(llvm::Attribute::AlwaysInline); @@ -935,7 +935,7 @@ CodeGenModule::shouldEmitFunction(const FunctionDecl *F) { if (getFunctionLinkage(F) != llvm::Function::AvailableExternallyLinkage) return true; if (CodeGenOpts.OptimizationLevel == 0 && - !F->hasAttr()) + !F->hasAttr() && !F->hasAttr()) return false; // PR9614. Avoid cases where the source code is lying to us. An available // externally function should have an equivalent function somewhere else, -- cgit v1.2.3-70-g09d2