ModuleLinker: Do not import linkonce/weak as "external_weak"

Summary:
There is no reason to have a weak reference because the external
definition will be weak.

Reviewers: rafael

Subscribers: llvm-commits, tejohnson

Differential Revision: http://reviews.llvm.org/D19267

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266750 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mehdi Amini 2016-04-19 16:11:05 +00:00
parent 75cc051139
commit 5c025fc0a6
2 changed files with 3 additions and 4 deletions

View File

@ -617,8 +617,7 @@ GlobalValue *IRLinker::copyGlobalValueProto(const GlobalValue *SGV,
if (ForDefinition)
NewGV->setLinkage(SGV->getLinkage());
else if (SGV->hasExternalWeakLinkage() || SGV->hasWeakLinkage() ||
SGV->hasLinkOnceLinkage())
else if (SGV->hasExternalWeakLinkage())
NewGV->setLinkage(GlobalValue::ExternalWeakLinkage);
NewGV->copyAttributesFrom(SGV);

View File

@ -5,5 +5,5 @@ $c = comdat any
@v = global i32 0, comdat ($c)
; CHECK: @v = global i32 0, comdat($c)
; CHECK: @v2 = extern_weak dllexport global i32
; CHECK: @v3 = extern_weak global i32
; CHECK: @v2 = external dllexport global i32
; CHECK: @v3 = external global i32