[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 00:51:17 PDT 2024


aheejin wrote:

Wasm's emscripten toolchain (https://github.com/emscripten-core/emscripten) has been using `_LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT` not to pay for the increased code size of `__libcpp_verbose_abort` so far. After this change, that macro does not exist. We don't provide our own vendor annotation, and defining `_LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT` as 0 is overridden by this line:
https://github.com/llvm/llvm-project/blob/38f5596feda3276a8aa64fc14e074334017088ca/libcxx/include/__availability#L138

I read the discussions in this PR; what I'm asking is not about backporting. I just would like to disable the verbose abort in the current version. I read about needing to create our own availability markup like Apple:
https://github.com/llvm/llvm-project/blob/38f5596feda3276a8aa64fc14e074334017088ca/libcxx/include/__availability#L163

But to do that it looks we have to copy the whole list of macros here
https://github.com/llvm/llvm-project/blob/38f5596feda3276a8aa64fc14e074334017088ca/libcxx/include/__availability#L86-L161
and copy them to our section in order to just change the one line (`_LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT`). Is this the recommended (or the only possible) way of changing one setting?

https://github.com/llvm/llvm-project/pull/71002


More information about the libcxx-commits mailing list