From feeeda70e23b5bd348d149eb2ba77c7c56d12ede Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 5 Jun 2009 22:58:34 +0000 Subject: weak_import should not make definitions have weak linkage. - clang treats weak_import like weak llvm-svn: 72967 --- clang/lib/CodeGen/CodeGenModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 6e8440a1773..5c12c81b36b 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -298,7 +298,7 @@ void CodeGenModule::SetFunctionDefinitionAttributes(const FunctionDecl *D, GV->setLinkage(llvm::Function::InternalLinkage); } else if (D->hasAttr()) { GV->setLinkage(llvm::Function::DLLExportLinkage); - } else if (D->hasAttr() || D->hasAttr()) { + } else if (D->hasAttr()) { GV->setLinkage(llvm::Function::WeakAnyLinkage); } else if (Linkage == GVA_C99Inline) { // In C99 mode, 'inline' functions are guaranteed to have a strong @@ -853,7 +853,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) { GV->setLinkage(llvm::Function::DLLImportLinkage); else if (D->hasAttr()) GV->setLinkage(llvm::Function::DLLExportLinkage); - else if (D->hasAttr() || D->hasAttr()) + else if (D->hasAttr()) GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage); else if (!CompileOpts.NoCommon && (!D->hasExternalStorage() && !D->getInit())) -- cgit v1.2.3