[libcxx-commits] [PATCH] D154796: [libc++] Recategorize additional instantiations in the dylib as availability macros

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 28 09:01:18 PDT 2023


ldionne added inline comments.


================
Comment at: libcxx/include/__availability:185
+// iostreams by providing a single strong definition in the shared library.
+// #   define _LIBCPP_AVAILABILITY_HAS_NO_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1
+
----------------
Here, let's do this instead:

```
// Enable additional explicit instantiations of iostreams components. This
// reduces the number of weak definitions generated in programs that use
// iostreams by providing a single strong definition in the shared library.
//
// TODO: Enable additional explicit instantiations on GCC once it supports 
//           exclude_from_explicit_instantiation, or once libc++ doesn't use the attribute anymore.
// TODO: Enable them on Windows once https://llvm.org/PR41018 has been fixed.
#if defined(_LIBCPP_COMPILER_GCC) || defined(_WIN32)
#  define _LIBCPP_AVAILABILITY_HAS_NO_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1
#else
// # define _LIBCPP_AVAILABILITY_HAS_NO_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1
#endif
```

Then you can remove the workarounds in `libcxx/include/sstream`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154796/new/

https://reviews.llvm.org/D154796



More information about the libcxx-commits mailing list