From 113adde594a0caae0ca52d0e5eddb916fc2b0858 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Tue, 19 Apr 2016 16:11:05 +0000 Subject: [PATCH] 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 llvm-svn: 266750 --- llvm/lib/Linker/IRMover.cpp | 3 +-- llvm/test/Linker/comdat14.ll | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp index 5b52ea8..81858bd4 100644 --- a/llvm/lib/Linker/IRMover.cpp +++ b/llvm/lib/Linker/IRMover.cpp @@ -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); diff --git a/llvm/test/Linker/comdat14.ll b/llvm/test/Linker/comdat14.ll index 793f857..9c6eb7c 100644 --- a/llvm/test/Linker/comdat14.ll +++ b/llvm/test/Linker/comdat14.ll @@ -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 -- 2.7.4