[libcxx-commits] [PATCH] D152378: [libc++][filesystem] Use _LIBCPP_HIDE_FROM_ABI in common headers

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 7 09:34:16 PDT 2023


philnik added a comment.

In D152378#4403640 <https://reviews.llvm.org/D152378#4403640>, @ldionne wrote:

> In D152378#4403616 <https://reviews.llvm.org/D152378#4403616>, @philnik wrote:
>
>> I don't think there is any need to mark the functions as `_LIBCPP_HIDE_FROM_ABI`. These are all implementation details of the dylib, which is built with `-fvisibility=hidden`, so these symbols can never escape the dylib, making this pure noise.
>
> These functions live in headers and they are included in multiple `.cpp` files that are linked together to create the dylib. Without `HIDE_FROM_ABI` and with the anonymous namespace, we get duplicate definitions in each `.o` file created using these headers. Also, the compiler complains about internal-linkage functions being unused in some of the `.cpp` files.

I understand that, but why not simply remove the anonymous namespace? What's the point of additionally adding `_LIBCPP_HIDE_FROM_ABI`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152378



More information about the libcxx-commits mailing list