[cfe-commits] r124837 - /cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Fariborz Jahanian fjahanian at apple.com
Thu Feb 3 16:32:39 PST 2011


Author: fjahanian
Date: Thu Feb  3 18:32:39 2011
New Revision: 124837

URL: http://llvm.org/viewvc/llvm-project?rev=124837&view=rev
Log:
minor refactoring of -fapple-kext stuff.

Modified:
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=124837&r1=124836&r2=124837&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Thu Feb  3 18:32:39 2011
@@ -1119,6 +1119,9 @@
     }
   }
   
+  if (Context.getLangOptions().AppleKext)
+    return llvm::Function::InternalLinkage;
+  
   switch (RD->getTemplateSpecializationKind()) {
   case TSK_Undeclared:
   case TSK_ExplicitSpecialization:
@@ -1127,19 +1130,14 @@
     // breaks LLVM's build due to undefined symbols.
     //   return llvm::GlobalVariable::AvailableExternallyLinkage;
   case TSK_ExplicitInstantiationDeclaration:
-    break;
+    return llvm::GlobalVariable::LinkOnceODRLinkage;
 
   case TSK_ExplicitInstantiationDefinition:
-    return !Context.getLangOptions().AppleKext ?
-             llvm::GlobalVariable::WeakODRLinkage :
-             llvm::Function::InternalLinkage;
-    
+      return llvm::GlobalVariable::WeakODRLinkage;
   }
   
   // Silence GCC warning.
-  return !Context.getLangOptions().AppleKext ?
-           llvm::GlobalVariable::LinkOnceODRLinkage :
-           llvm::Function::InternalLinkage;
+  return llvm::GlobalVariable::LinkOnceODRLinkage;
 }
 
 CharUnits CodeGenModule::GetTargetTypeStoreSize(const llvm::Type *Ty) const {





More information about the cfe-commits mailing list