summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2020-01-14 09:13:15 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2020-01-14 09:14:28 -0800
commitfd19ffc6a502f8e647696d550abb04a6c8c1b182 (patch)
tree08b02f9eca60171641ef71c718b8ed09ba57a0ab /lldb/source
parentc8a14c2d4773841daa303736332d0038ead6f36a (diff)
downloadbcm5719-llvm-fd19ffc6a502f8e647696d550abb04a6c8c1b182.tar.gz
bcm5719-llvm-fd19ffc6a502f8e647696d550abb04a6c8c1b182.zip
[lldb/Utility] Use assert instead of llvm_unreachable for LLDBAssert
llvm_unreachable is marked noreturn so the compiler can assume the code for printing the error message in release builds isn't hit which defeats the purpose.
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Utility/LLDBAssert.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Utility/LLDBAssert.cpp b/lldb/source/Utility/LLDBAssert.cpp
index 75530d80631..361d6d04a28 100644
--- a/lldb/source/Utility/LLDBAssert.cpp
+++ b/lldb/source/Utility/LLDBAssert.cpp
@@ -21,10 +21,10 @@ void lldb_private::lldb_assert(bool expression, const char *expr_text,
if (LLVM_LIKELY(expression))
return;
- // In a Debug configuration lldb_assert() behaves like assert(0).
- llvm_unreachable("lldb_assert failed");
+ // If asserts are enabled abort here.
+ assert(false && "lldb_assert failed");
- // In a Release configuration it will print a warning and encourage the user
+ // 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
// execution.
errs() << format("Assertion failed: (%s), function %s, file %s, line %u\n",
OpenPOWER on IntegriCloud