[llvm] r255272 - Fix another case where the linkage was not set.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 10 10:44:27 PST 2015
Author: rafael
Date: Thu Dec 10 12:44:26 2015
New Revision: 255272
URL: http://llvm.org/viewvc/llvm-project?rev=255272&view=rev
Log:
Fix another case where the linkage was not set.
Modified:
llvm/trunk/lib/Linker/IRMover.cpp
llvm/trunk/test/Linker/Inputs/available_externally_over_decl.ll
llvm/trunk/test/Linker/available_externally_over_decl.ll
Modified: llvm/trunk/lib/Linker/IRMover.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/IRMover.cpp?rev=255272&r1=255271&r2=255272&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/IRMover.cpp (original)
+++ llvm/trunk/lib/Linker/IRMover.cpp Thu Dec 10 12:44:26 2015
@@ -831,7 +831,7 @@ static bool useExistingDest(GlobalValue
if (SGV.isDeclaration())
return true;
- if (DGV->isDeclarationForLinker())
+ if (DGV->isDeclarationForLinker() && !SGV.isDeclarationForLinker())
return false;
if (ShouldLink)
Modified: llvm/trunk/test/Linker/Inputs/available_externally_over_decl.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/Inputs/available_externally_over_decl.ll?rev=255272&r1=255271&r2=255272&view=diff
==============================================================================
--- llvm/trunk/test/Linker/Inputs/available_externally_over_decl.ll (original)
+++ llvm/trunk/test/Linker/Inputs/available_externally_over_decl.ll Thu Dec 10 12:44:26 2015
@@ -1,5 +1,10 @@
@h = global void ()* @f
+ at h2 = global void ()* @g
define available_externally void @f() {
ret void
}
+
+define available_externally void @g() {
+ ret void
+}
Modified: llvm/trunk/test/Linker/available_externally_over_decl.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/available_externally_over_decl.ll?rev=255272&r1=255271&r2=255272&view=diff
==============================================================================
--- llvm/trunk/test/Linker/available_externally_over_decl.ll (original)
+++ llvm/trunk/test/Linker/available_externally_over_decl.ll Thu Dec 10 12:44:26 2015
@@ -2,8 +2,14 @@
declare void @f()
+define available_externally void @g() {
+ ret void
+}
+
define void ()* @main() {
+ call void @g()
ret void ()* @f
}
-; CHECK: define available_externally void @f() {
+; CHECK-DAG: define available_externally void @g() {
+; CHECK-DAG: define available_externally void @f() {
More information about the llvm-commits
mailing list