From e28342c4013c6646315d854adfc46defaf8a37e7 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 4 Feb 2011 00:32:39 +0000 Subject: minor refactoring of -fapple-kext stuff. llvm-svn: 124837 --- clang/lib/CodeGen/CodeGenModule.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 150d0c4..a086bad 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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 { -- cgit v1.1