aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
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
commitef372018c2dc0f8c2e5c34698401b87077eef6ed (patch)
treececb95451e8a2ec8d8fa20257b2ab0719e76de43 /lib/CodeGen/CodeGenModule.cpp
parente1f84f8e4cd02347ab0e74eb8f328b3bcacb369c (diff)
Add code to skip the emission of available externally functions at -O0. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92749 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index d497471e45..16a01cfd58 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/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);
}