[libcxx-commits] [libcxx] [libc++][NFC] Refactor _LIBCPP_AVAILABILITY_HAS_* macros to always be defined (PR #71002)
Heejin Ahn via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Mar 28 13:35:34 PDT 2024
aheejin wrote:
What I was trying to say is, gating `_LIBCPP_ASSERTION_HANDLER` on debug/release mode is not sufficient to prevent code size increase in the relase mode. There are dozens of places in libc++ that directly call `_LIBCPP_VERBOSE_ABORT`, like these:
https://github.com/llvm/llvm-project/blob/688d71ea8817ace88955671c1af7c80fbfba2c7f/libcxx/include/stdexcept#L214-L276
or this:
https://github.com/llvm/llvm-project/blob/688d71ea8817ace88955671c1af7c80fbfba2c7f/libcxx/src/new_helpers.cpp#L24
which has nothing to do with `_LIBCPP_ASSERTION_HANDLER`.
I can file an issue but I wanted to check first this was really an issue, meaning, if there was a solution and I wasn't aware of it. And this after PR, it looks controlling a specific single setting becomes very difficult in general. What Apple did was copy-pasting the whole set of section into their `#elif defined(__APPLE__)` and modified the ones they wanted to. If we have many settings we want to modify that would be fine, but having to copy-paste dozens of settings to modify a single setting seems excessive, if that's the only way to do it.
https://github.com/llvm/llvm-project/pull/71002
More information about the libcxx-commits
mailing list