[PATCH] D36729: Fix two (three) more issues with unchecked Error.
Stephen Hines via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 15 17:09:38 PDT 2017
srhines updated this revision to Diff 111289.
srhines added a comment.
Switch to cantFail
https://reviews.llvm.org/D36729
Files:
include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
unittests/Support/ErrorTest.cpp
Index: unittests/Support/ErrorTest.cpp
===================================================================
--- unittests/Support/ErrorTest.cpp
+++ unittests/Support/ErrorTest.cpp
@@ -482,7 +482,7 @@
}
// Test that cantFail results in a crash if you pass it a failure value.
-#if LLVM_ENABLE_ABI_BREAKING_CHECKS
+#if LLVM_ENABLE_ABI_BREAKING_CHECKS && !defined(NDEBUG)
TEST(Error, CantFailDeath) {
EXPECT_DEATH(
cantFail(make_error<StringError>("foo", inconvertibleErrorCode())),
Index: include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
===================================================================
--- include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
+++ include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
@@ -171,7 +171,7 @@
auto Err = Client.deregisterEHFrames(Frame.Addr, Frame.Size);
// FIXME: Add error poll.
assert(!Err && "Failed to register remote EH frames.");
- (void)Err;
+ llvm::cantFail(std::move(Err));
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36729.111289.patch
Type: text/x-patch
Size: 1018 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170816/46405202/attachment.bin>
More information about the llvm-commits
mailing list