[libcxx-commits] [PATCH] D123175: [libcxx] Add flag to turn on/off __builtin_assume in _LIBCPP_ASSERT
Nikolas Klauser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Apr 6 00:13:59 PDT 2022
philnik added inline comments.
================
Comment at: libcxx/include/__assert:36-45
+// Set -D_LIBCPP_ASSERTIONS_ENABLE_ASSUME=0 to turn off calling
+// __builtin_assume() in _LIBCPP_ASSERT() when _LIBCPP_ENABLE_ASSERTIONS == 0.
+#ifndef _LIBCPP_ASSERTIONS_ENABLE_ASSUME
+# define _LIBCPP_ASSERTIONS_ENABLE_ASSUME 1
+#endif
+
+#if _LIBCPP_ASSERTIONS_ENABLE_ASSUME != 0 && _LIBCPP_ASSERTIONS_ENABLE_ASSUME != 1
----------------
I think the disable things flags are normally 'define it to disable this part', so the flag should be `_LIBCPP_ASSERTIONS_DISABLE_ASSUME`. That would allow you to remove this whole block and just have `!defined(_LIBCPP_ASSERTIONS_DISABLE_ASSUME)` in line 51.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123175/new/
https://reviews.llvm.org/D123175
More information about the libcxx-commits
mailing list