Skip to content

Commit 5079f3b

Browse files
committed
Update LLD for D20550.
Differential Revision: http://reviews.llvm.org/D20704 llvm-svn: 270968
1 parent 1eaa97f commit 5079f3b

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

lld/ELF/LTO.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,12 @@ void BitcodeCompiler::add(BitcodeFile &F) {
218218
Keep.push_back(GV);
219219
}
220220

221-
Mover.move(Obj->takeModule(), Keep,
222-
[](GlobalValue &, IRMover::ValueAdder) {});
221+
if (Error E = Mover.move(Obj->takeModule(), Keep,
222+
[](GlobalValue &, IRMover::ValueAdder) {})) {
223+
handleAllErrors(std::move(E), [&](const llvm::ErrorInfoBase &EIB) {
224+
fatal("failed to link module " + F.getName() + ": " + EIB.message());
225+
});
226+
}
223227
}
224228

225229
static void internalize(GlobalValue &GV) {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
target triple = "x86_64-unknown-linux-gnu"
2+
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
3+
4+
!0 = !{ i32 1, !"foo", i32 2 }
5+
6+
!llvm.module.flags = !{ !0 }

lld/test/ELF/lto/irmover-error.ll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
; RUN: llvm-as -o %t1.bc %s
2+
; RUN: llvm-as -o %t2.bc %S/Inputs/irmover-error.ll
3+
; RUN: not ld.lld -m elf_x86_64 %t1.bc %t2.bc -o %t 2>&1 | FileCheck %s
4+
5+
; CHECK: failed to link module {{.*}}2.bc: linking module flags 'foo': IDs have conflicting values
6+
7+
target triple = "x86_64-unknown-linux-gnu"
8+
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
9+
10+
!0 = !{ i32 1, !"foo", i32 1 }
11+
12+
!llvm.module.flags = !{ !0 }

0 commit comments

Comments
 (0)