[PATCH] D36729: Fix two (three) more issues with unchecked Error.

Stephen Hines via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 17:49:45 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL311739: Fix two (three) more issues with unchecked Error. (authored by srhines).

Repository:
  rL LLVM

https://reviews.llvm.org/D36729

Files:
  llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
  llvm/trunk/unittests/Support/ErrorTest.cpp


Index: llvm/trunk/unittests/Support/ErrorTest.cpp
===================================================================
--- llvm/trunk/unittests/Support/ErrorTest.cpp
+++ llvm/trunk/unittests/Support/ErrorTest.cpp
@@ -483,7 +483,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: llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
===================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
@@ -168,10 +168,8 @@
 
     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));
       }
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36729.112641.patch
Type: text/x-patch
Size: 1212 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170825/d312e924/attachment.bin>


More information about the llvm-commits mailing list