Remove the dependancy on NDEBUG, especially in public headers, by using
a new variable, LLVM_ENABLE_DEBUG, which will make it easier to include llvm
headers in other applications which may define NDEBUG differently.
This change only defines the new variable, but if accepted, the following
changes can be made to headers as needed:
s/#ifndef NDEBUG/#ifdef LLVM_ENABLE_DEBUG/
s/!defined(NDEBUG)/defined(LLVM_ENABLE_DEBUG)/
This is similar to changes originally proposed by @tstellar:
https://reviews.llvm.org/D11833 and https://reviews.llvm.org/D11834
- This patch includes changes to CMakeLists.txt from D38406
which is still under review.
I think we already have the LLVM_ENABLE_ASSERTIONS flag and should not introduce yet another one. We may or may not use LLVM_ENABLE_DEBUG instead of LLVM_ENABLE_ASSERTIONS for the preprocessor define.