forked from OSchip/llvm-project
[ELF] Update lld now that ELF.h in LLVM has been converted to Expected.
llvm-svn: 287082
This commit is contained in:
parent
6cf09265f9
commit
197f07e650
|
@ -51,10 +51,18 @@ template <class T> T check(ErrorOr<T> E) {
|
||||||
return std::move(*E);
|
return std::move(*E);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void check(Error E) {
|
||||||
|
handleAllErrors(std::move(E), [&](llvm::ErrorInfoBase &EIB) -> Error {
|
||||||
|
fatal(EIB.message());
|
||||||
|
return Error::success();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
template <class T> T check(Expected<T> E) {
|
template <class T> T check(Expected<T> E) {
|
||||||
if (!E)
|
if (E)
|
||||||
fatal(errorToErrorCode(E.takeError()).message());
|
return std::move(*E);
|
||||||
return std::move(*E);
|
check(E.takeError());
|
||||||
|
return T();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T> T check(ErrorOr<T> E, const Twine &Prefix) {
|
template <class T> T check(ErrorOr<T> E, const Twine &Prefix) {
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
## .MIPS.options with size of zero.
|
## .MIPS.options with size of zero.
|
||||||
# RUN: not ld.lld %p/Inputs/mips-invalid-options-descriptor.elf -o %t2 2>&1 | \
|
# RUN: not ld.lld %p/Inputs/mips-invalid-options-descriptor.elf -o %t2 2>&1 | \
|
||||||
# RUN: FileCheck %s
|
# RUN: FileCheck %s
|
||||||
# CHECK: error: Invalid data was encountered while parsing the file
|
# CHECK: error: invalid section offset
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
## sht-group.elf contains SHT_GROUP section with invalid sh_info.
|
## sht-group.elf contains SHT_GROUP section with invalid sh_info.
|
||||||
# RUN: not ld.lld %p/Inputs/sht-group.elf -o %t2 2>&1 | FileCheck %s
|
# RUN: not ld.lld %p/Inputs/sht-group.elf -o %t2 2>&1 | FileCheck %s
|
||||||
# CHECK: Invalid symbol index
|
# CHECK: invalid symbol index
|
||||||
|
|
Loading…
Reference in New Issue