Adjust LLVM_ENABLE_ABI_BREAKING_CHECKS depending on NDEBUG

When assertions are disabled, the upstream build system disables
LLVM_ENABLE_ABI_BREAKING_CHECKS by default. Though the upstream build
system allows it to be force-enabled, it looks like that is not a
well-tested build-time configuration.

Therefore, always disable LLVM_ENABLE_ABI_BREAKING_CHECKS when
assertions are disabled, which will also save some more runtime cost
when people use WITHOUT_LLVM_ASSERTIONS.

PR:		280562
MFC after:	1 month

(cherry picked from commit 1c83996bed)
This commit is contained in:
Dimitry Andric 2024-10-24 11:53:19 +02:00
parent 24f861874c
commit 86de9cd1f1

View file

@ -13,7 +13,11 @@
#define LLVM_ABI_BREAKING_CHECKS_H
/* Define to enable checks that alter the LLVM C++ ABI */
#ifdef NDEBUG
#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
#else
#define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
#endif
/* Define to enable reverse iteration of unordered llvm containers */
#define LLVM_ENABLE_REVERSE_ITERATION 0