]> granicus.if.org Git - clang/commitdiff
Add code to skip the emission of available externally functions at -O0. WIP.
authorMike Stump <mrs@apple.com>
Tue, 5 Jan 2010 18:48:04 +0000 (18:48 +0000)
committerMike Stump <mrs@apple.com>
Tue, 5 Jan 2010 18:48:04 +0000 (18:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92749 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp

index d497471e4597bfcdf4204085e70436054c09c5f8..16a01cfd58f3833664bfee80fc5db0551523457e 100644 (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);
   }