git: 1c83996beda7 - main - Adjust LLVM_ENABLE_ABI_BREAKING_CHECKS depending on NDEBUG
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 24 Oct 2024 09:53:40 UTC
The branch main has been updated by dim:
URL: https://cgit.FreeBSD.org/src/commit/?id=1c83996beda7b6a382857c318f46daefcb6bd84c
commit 1c83996beda7b6a382857c318f46daefcb6bd84c
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-10-24 09:53:19 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-10-24 09:53:19 +0000
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
---
lib/clang/include/llvm/Config/abi-breaking.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/clang/include/llvm/Config/abi-breaking.h b/lib/clang/include/llvm/Config/abi-breaking.h
index eb90be1fe37b..55e67e2ebad7 100644
--- a/lib/clang/include/llvm/Config/abi-breaking.h
+++ b/lib/clang/include/llvm/Config/abi-breaking.h
@@ -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