Add a cmake flag to turn `llvm_unreachable()` into builtin_trap() when assertions...
authorMehdi Amini <joker.eph@gmail.com>
Thu, 17 Mar 2022 22:19:33 +0000 (22:19 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Fri, 18 Mar 2022 19:24:14 +0000 (19:24 +0000)
commit7b983917d455500f6b861f289f252718290f36ac
tree1c592973fa2698f2551b9e326da838997ad0b790
parent89d8035e36c927bd3cb88dba49b9f97d6c9dbc68
Add a cmake flag to turn `llvm_unreachable()` into builtin_trap() when assertions are disabled

This re-lands 6316129e066e after fixing the condition logic.

The new flag seems to not be working yet on Windows, where the builtin
trap isn't "no return".

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D121750
llvm/CMakeLists.txt
llvm/docs/CMake.rst
llvm/include/llvm/Config/llvm-config.h.cmake
llvm/include/llvm/Support/ErrorHandling.h