From ab578bf355029bc61cd37bfd99e1d72028db672f Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Mon, 20 Jun 2011 17:50:03 +0000 Subject: llvm-gcc treats a tentative definition with a previous (or follow up) extern declaration with weak_import as an actual definition. make clang follows this behavior. // rdar://9538608 llvm-gcc treats an extern declaration with weak_import llvm-svn: 133450 --- clang/lib/CodeGen/CodeGenModule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 57b4f7f..7f4546f 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1351,7 +1351,8 @@ CodeGenModule::GetLLVMLinkageVarDefinition(const VarDecl *D, ((!CodeGenOpts.NoCommon && !D->getAttr()) || D->getAttr()) && !D->hasExternalStorage() && !D->getInit() && - !D->getAttr() && !D->isThreadSpecified()) { + !D->getAttr() && !D->isThreadSpecified() && + !D->getAttr()) { // Thread local vars aren't considered common linkage. return llvm::GlobalVariable::CommonLinkage; } -- cgit v1.1