diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2014-02-25 09:53:29 +0000 | 
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2014-02-25 09:53:29 +0000 | 
| commit | 67e541e1c80252425487b270d29732f2ba1166b5 (patch) | |
| tree | 603320649e53b077371275e81d935b009b064bb1 /clang/lib/CodeGen | |
| parent | 01143f9a517ff0be74594286601f2d4a2a514c36 (diff) | |
| download | bcm5719-llvm-67e541e1c80252425487b270d29732f2ba1166b5.tar.gz bcm5719-llvm-67e541e1c80252425487b270d29732f2ba1166b5.zip  | |
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
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 6 | 
2 files changed, 3 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 409d1141b81..e81b1bccb17 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -527,8 +527,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD,            Fn->addFnAttr(llvm::Attribute::InlineHint);            break;          } -    } else if (!FD->hasAttr<AlwaysInlineAttr>() && -               !FD->hasAttr<ForceInlineAttr>()) +    } else if (!FD->hasAttr<AlwaysInlineAttr>())        Fn->addFnAttr(llvm::Attribute::NoInline);    } 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<NoInlineAttr>()) {      B.addAttribute(llvm::Attribute::NoInline); -  } else if ((D->hasAttr<AlwaysInlineAttr>() || -              D->hasAttr<ForceInlineAttr>()) && +  } else if (D->hasAttr<AlwaysInlineAttr>() &&               !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<FunctionDecl>(GD.getDecl()); -  if (CodeGenOpts.OptimizationLevel == 0 && -      !F->hasAttr<AlwaysInlineAttr>() && !F->hasAttr<ForceInlineAttr>()) +  if (CodeGenOpts.OptimizationLevel == 0 && !F->hasAttr<AlwaysInlineAttr>())      return false;    // PR9614. Avoid cases where the source code is lying to us. An available    // externally function should have an equivalent function somewhere else,  | 

