Don't suppress the emission of available_externally functions marked

with always_inline attribute. Thanks to Howard for the tip.

llvm-svn: 108469
This commit is contained in:
Douglas Gregor
2010-07-15 22:58:18 +00:00
parent b3026df9fa
commit 8997690ff1
2 changed files with 16 additions and 1 deletions

View File

@@ -816,7 +816,8 @@ void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD) {
if (const FunctionDecl *Function = dyn_cast<FunctionDecl>(D)) {
// At -O0, don't generate IR for functions with available_externally
// linkage.
if (CodeGenOpts.OptimizationLevel == 0 &&
if (CodeGenOpts.OptimizationLevel == 0 &&
!Function->hasAttr<AlwaysInlineAttr>() &&
getFunctionLinkage(Function)
== llvm::Function::AvailableExternallyLinkage)
return;