summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2010-01-05 18:48:04 +0000
committerMike Stump <mrs@apple.com>2010-01-05 18:48:04 +0000
commit79ed590c85749e088e80506c831a3da292122c9c (patch)
tree1ce76312084bb3e0f18b72d914f620b70f9df4a0 /clang/lib
parent60b0a86a08a737172bdfc214444f621a9f4b65e2 (diff)
downloadbcm5719-llvm-79ed590c85749e088e80506c831a3da292122c9c.tar.gz
bcm5719-llvm-79ed590c85749e088e80506c831a3da292122c9c.zip
Add code to skip the emission of available externally functions at -O0. WIP.
llvm-svn: 92749
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index d497471e459..16a01cfd58f 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -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);
}
OpenPOWER on IntegriCloud