From 67e541e1c80252425487b270d29732f2ba1166b5 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Tue, 25 Feb 2014 09:53:29 +0000 Subject: Attr: Remove ForceInline The __forceinline keyword's semantics are now recast as AlwaysInline and the kw___forceinline token has its language mode set for KEYMS. This preserves the semantics of the previous implementation but with less duplication of code. llvm-svn: 202131 --- clang/lib/CodeGen/CodeGenModule.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index e6798e49a85..f7b518abc57 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -635,8 +635,7 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, B.addAttribute(llvm::Attribute::NoDuplicate); } else if (D->hasAttr()) { B.addAttribute(llvm::Attribute::NoInline); - } else if ((D->hasAttr() || - D->hasAttr()) && + } else if (D->hasAttr() && !F->getAttributes().hasAttribute(llvm::AttributeSet::FunctionIndex, llvm::Attribute::NoInline)) { // (noinline wins over always_inline, and we can't specify both in IR) @@ -1245,8 +1244,7 @@ CodeGenModule::shouldEmitFunction(GlobalDecl GD) { if (getFunctionLinkage(GD) != llvm::Function::AvailableExternallyLinkage) return true; const FunctionDecl *F = cast(GD.getDecl()); - if (CodeGenOpts.OptimizationLevel == 0 && - !F->hasAttr() && !F->hasAttr()) + if (CodeGenOpts.OptimizationLevel == 0 && !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