[PATCH] D121750: Add a cmake flag to turn `llvm_unreachable()` into builtin_trap() when assertions are disabled

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 16 14:29:46 PDT 2022


mehdi_amini added a comment.

> Or: LLVM_UNREACHABLE_OPTIMIZE=OFF?
> (Reasoning: it's disabling the optimization opportunity in no-asserts builds but leaving behind the debugging feature in asserts builds.)

I like the naming! I had the same reasoning but didn't find a good name :)



================
Comment at: llvm/include/llvm/Support/ErrorHandling.h:127-128
 /// In !NDEBUG builds, prints the message and location info to stderr.
 /// In NDEBUG builds, becomes an optimizer hint that the current location
 /// is not supposed to be reachable.  On compilers that don't support
 /// such hints, prints a reduced message instead and aborts the program.
----------------
dexonsmith wrote:
> I think this part of the comment should be updated.
Done! PTAL 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121750/new/

https://reviews.llvm.org/D121750



More information about the llvm-commits mailing list