Add code to skip the emission of available externally functions at -O0. WIP.

llvm-svn: 92749
This commit is contained in:
Mike Stump
2010-01-05 18:48:04 +00:00
parent 60b0a86a08
commit 79ed590c85

View File

@@ -468,6 +468,16 @@ void CodeGenModule::EmitDeferred() {
if (!CGRef->isDeclaration())
continue;
// Skip available externally functions at -O0
// FIXME: these aren't instantiated yet, so we can't yet do this.
if (0 && getCodeGenOpts().OptimizationLevel == 0)
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D.getDecl())) {
GVALinkage Linkage = GetLinkageForFunction(getContext(), FD, Features);
if (Linkage == GVA_C99Inline)
continue;
}
// Otherwise, emit the definition and move on to the next one.
EmitGlobalDefinition(D);
}