aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-06-20 17:50:03 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-06-20 17:50:03 +0000
commitab27d6ea7b4ce2762a16905281de796db32bb6f2 (patch)
tree2d9752b470843ef1b270db7d85fbb9a37ae69414 /lib/CodeGen/CodeGenModule.cpp
parent6fe6bac2ad79dee2fb2077c8959b1bf8679fe1b7 (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 57b4f7f2ae..7f4546f079 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -1351,7 +1351,8 @@ CodeGenModule::GetLLVMLinkageVarDefinition(const VarDecl *D,
((!CodeGenOpts.NoCommon && !D->getAttr<NoCommonAttr>()) ||
D->getAttr<CommonAttr>()) &&
!D->hasExternalStorage() && !D->getInit() &&
- !D->getAttr<SectionAttr>() && !D->isThreadSpecified()) {
+ !D->getAttr<SectionAttr>() && !D->isThreadSpecified() &&
+ !D->getAttr<WeakImportAttr>()) {
// Thread local vars aren't considered common linkage.
return llvm::GlobalVariable::CommonLinkage;
}