mirror of
https://github.com/intel/llvm.git
synced 2026-01-31 16:05:09 +08:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user