Commit fd19ffc6 authored by Jonas Devlieghere's avatar Jonas Devlieghere
Browse files

[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.
parent c8a14c2d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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",