[Lldb-commits] [lldb] r365250 - [LLDBAssert] Use unreachable instead of assert(0)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 5 14:54:20 PDT 2019


Author: jdevlieghere
Date: Fri Jul  5 14:54:20 2019
New Revision: 365250

URL: http://llvm.org/viewvc/llvm-project?rev=365250&view=rev
Log:
[LLDBAssert] Use unreachable instead of assert(0)

As per Davide's suggestion offline.

Modified:
    lldb/trunk/source/Utility/LLDBAssert.cpp

Modified: lldb/trunk/source/Utility/LLDBAssert.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/LLDBAssert.cpp?rev=365250&r1=365249&r2=365250&view=diff
==============================================================================
--- lldb/trunk/source/Utility/LLDBAssert.cpp (original)
+++ lldb/trunk/source/Utility/LLDBAssert.cpp Fri Jul  5 14:54:20 2019
@@ -21,8 +21,8 @@ void lldb_private::lldb_assert(bool expr
   if (LLVM_LIKELY(expression))
     return;
 
-  // In a Debug configuration lldb_assert() behaves like assert().
-  assert(false && "lldb_assert failed");
+  // In a Debug configuration lldb_assert() behaves like assert(0).
+  llvm_unreachable("lldb_assert failed");
 
   // In a Release configuration it will print a warning and encourage the user
   // to file a bug report, similar to LLVM’s crash handler, and then return




More information about the lldb-commits mailing list