[llvm] r217445 - Fix a use of an undefined value (the linkage).
Rafael Espindola
rafael.espindola at gmail.com
Tue Sep 9 07:52:28 PDT 2014
Author: rafael
Date: Tue Sep 9 09:52:27 2014
New Revision: 217445
URL: http://llvm.org/viewvc/llvm-project?rev=217445&view=rev
Log:
Fix a use of an undefined value (the linkage).
Modified:
llvm/trunk/lib/Linker/LinkModules.cpp
llvm/trunk/test/Linker/Inputs/linkage2.ll
llvm/trunk/test/Linker/linkage2.ll
Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=217445&r1=217444&r2=217445&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Tue Sep 9 09:52:27 2014
@@ -705,6 +705,9 @@ bool ModuleLinker::getLinkageResult(Glob
if (DestIsDeclaration) {
LinkFromSrc = true;
LT = Src->getLinkage();
+ } else {
+ LinkFromSrc = false;
+ LT = Dest->getLinkage();
}
} else if (Dest->hasExternalWeakLinkage()) {
// If the Dest is weak, use the source linkage.
Modified: llvm/trunk/test/Linker/Inputs/linkage2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/Inputs/linkage2.ll?rev=217445&r1=217444&r2=217445&view=diff
==============================================================================
--- llvm/trunk/test/Linker/Inputs/linkage2.ll (original)
+++ llvm/trunk/test/Linker/Inputs/linkage2.ll Tue Sep 9 09:52:27 2014
@@ -1 +1,3 @@
@test1_a = weak global i8 1
+
+ at test2_a = external dllimport global i8
Modified: llvm/trunk/test/Linker/linkage2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/linkage2.ll?rev=217445&r1=217444&r2=217445&view=diff
==============================================================================
--- llvm/trunk/test/Linker/linkage2.ll (original)
+++ llvm/trunk/test/Linker/linkage2.ll Tue Sep 9 09:52:27 2014
@@ -2,5 +2,7 @@
; RUN: llvm-link %p/Inputs/linkage2.ll %s -S | FileCheck %s
@test1_a = common global i8 0
-
; CHECK: @test1_a = common global i8 0
+
+ at test2_a = global i8 0
+; CHECK: @test2_a = global i8 0
More information about the llvm-commits
mailing list