[PATCH] D19267: ModuleLinker: Do not import linkonce/weak as "external_weak"

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 08:49:13 PDT 2016


joker.eph created this revision.
joker.eph added a reviewer: rafael.
joker.eph added subscribers: tejohnson, llvm-commits.

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

http://reviews.llvm.org/D19267

Files:
  lib/Linker/IRMover.cpp
  test/Linker/comdat14.ll

Index: test/Linker/comdat14.ll
===================================================================
--- test/Linker/comdat14.ll
+++ test/Linker/comdat14.ll
@@ -5,5 +5,5 @@
 @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
Index: lib/Linker/IRMover.cpp
===================================================================
--- lib/Linker/IRMover.cpp
+++ lib/Linker/IRMover.cpp
@@ -617,8 +617,7 @@
 
   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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19267.54203.patch
Type: text/x-patch
Size: 901 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160419/3b023052/attachment.bin>


More information about the llvm-commits mailing list