From: Fariborz Jahanian Date: Fri, 4 Feb 2011 00:32:39 +0000 (+0000) Subject: minor refactoring of -fapple-kext stuff. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=53bad4e98ed5e765df4231099bf1c737582908bf;p=clang minor refactoring of -fapple-kext stuff. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124837 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 150d0c46ab..a086badfa8 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1119,6 +1119,9 @@ CodeGenModule::getVTableLinkage(const CXXRecordDecl *RD) { } } + if (Context.getLangOptions().AppleKext) + return llvm::Function::InternalLinkage; + switch (RD->getTemplateSpecializationKind()) { case TSK_Undeclared: case TSK_ExplicitSpecialization: @@ -1127,19 +1130,14 @@ CodeGenModule::getVTableLinkage(const CXXRecordDecl *RD) { // 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 {