diff options
| author | Stephen Hines <srhines@google.com> | 2017-08-25 00:48:21 +0000 |
|---|---|---|
| committer | Stephen Hines <srhines@google.com> | 2017-08-25 00:48:21 +0000 |
| commit | cc14a386d876a6dbcd9bb33b8dc6f0ed52f04486 (patch) | |
| tree | b784f38567f9cfc2eb5dc578f274a559c8fdb13d /llvm | |
| parent | 8ac488b16185a70f1f2589a3d0447ddedb7f73e3 (diff) | |
| download | bcm5719-llvm-cc14a386d876a6dbcd9bb33b8dc6f0ed52f04486.tar.gz bcm5719-llvm-cc14a386d876a6dbcd9bb33b8dc6f0ed52f04486.zip | |
Fix two (three) more issues with unchecked Error.
Summary:
If assertions are disabled, but LLVM_ABI_BREAKING_CHANGES is enabled,
this will cause an issue with an unchecked Success. Switching to
consumeError() is the correct way to bypass the check. This patch also
includes disabling 2 tests that can't work without assertions enabled,
since llvm_unreachable() with NDEBUG won't crash.
Reviewers: llvm-commits, lhames
Reviewed By: lhames
Subscribers: lhames, pirama
Differential Revision: https://reviews.llvm.org/D36729
llvm-svn: 311739
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h | 4 | ||||
| -rw-r--r-- | llvm/unittests/Support/ErrorTest.cpp | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h b/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h index da02250ba16..c602f1d542f 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h @@ -168,10 +168,8 @@ public: void deregisterEHFrames() override { for (auto &Frame : RegisteredEHFrames) { - auto Err = Client.deregisterEHFrames(Frame.Addr, Frame.Size); // FIXME: Add error poll. - assert(!Err && "Failed to register remote EH frames."); - (void)Err; + llvm::cantFail(Client.deregisterEHFrames(Frame.Addr, Frame.Size)); } } diff --git a/llvm/unittests/Support/ErrorTest.cpp b/llvm/unittests/Support/ErrorTest.cpp index 9f22892374a..852753fbf04 100644 --- a/llvm/unittests/Support/ErrorTest.cpp +++ b/llvm/unittests/Support/ErrorTest.cpp @@ -483,7 +483,7 @@ TEST(Error, CantFailSuccess) { } // 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())), |

