[lld] r287082 - [ELF] Update lld now that ELF.h in LLVM has been converted to Expected.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 15 21:11:30 PST 2016
Author: davide
Date: Tue Nov 15 23:11:30 2016
New Revision: 287082
URL: http://llvm.org/viewvc/llvm-project?rev=287082&view=rev
Log:
[ELF] Update lld now that ELF.h in LLVM has been converted to Expected.
Modified:
lld/trunk/ELF/Error.h
lld/trunk/test/ELF/invalid/mips-invalid-options-descriptor.s
lld/trunk/test/ELF/invalid/sht-group.s
Modified: lld/trunk/ELF/Error.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Error.h?rev=287082&r1=287081&r2=287082&view=diff
==============================================================================
--- lld/trunk/ELF/Error.h (original)
+++ lld/trunk/ELF/Error.h Tue Nov 15 23:11:30 2016
@@ -51,10 +51,18 @@ template <class T> T check(ErrorOr<T> 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) {
- if (!E)
- fatal(errorToErrorCode(E.takeError()).message());
- return std::move(*E);
+ if (E)
+ return std::move(*E);
+ check(E.takeError());
+ return T();
}
template <class T> T check(ErrorOr<T> E, const Twine &Prefix) {
Modified: lld/trunk/test/ELF/invalid/mips-invalid-options-descriptor.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/invalid/mips-invalid-options-descriptor.s?rev=287082&r1=287081&r2=287082&view=diff
==============================================================================
--- lld/trunk/test/ELF/invalid/mips-invalid-options-descriptor.s (original)
+++ lld/trunk/test/ELF/invalid/mips-invalid-options-descriptor.s Tue Nov 15 23:11:30 2016
@@ -2,4 +2,4 @@
## .MIPS.options with size of zero.
# RUN: not ld.lld %p/Inputs/mips-invalid-options-descriptor.elf -o %t2 2>&1 | \
# RUN: FileCheck %s
-# CHECK: error: Invalid data was encountered while parsing the file
+# CHECK: error: invalid section offset
Modified: lld/trunk/test/ELF/invalid/sht-group.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/invalid/sht-group.s?rev=287082&r1=287081&r2=287082&view=diff
==============================================================================
--- lld/trunk/test/ELF/invalid/sht-group.s (original)
+++ lld/trunk/test/ELF/invalid/sht-group.s Tue Nov 15 23:11:30 2016
@@ -1,3 +1,3 @@
## 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
-# CHECK: Invalid symbol index
+# CHECK: invalid symbol index
More information about the llvm-commits
mailing list