These macros are always defined identically, so we can simplify the code a bit by merging them.
Details
- Reviewers
ldionne - Group Reviewers
Restricted Project - Commits
- rGf1ea0b11ca03: [libc++] Merge _LIBCPP_FUNC_VIS, _LIBCPP_TYPE_VIS and _LIBCPP_EXCEPTION_ABI…
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This makes sense to me, however we also probably want to take a look at the other _VIS macros and see if we can remove them in favor of _LIBCPP_EXPORTED_FROM_ABI or variants of it (e.g. applying type_visibility(default) at the namespace scope to get rid of _LIBCPP_ENUM_VIS).
Heads up @smeenai, does this make sense to you?
libcxx/include/__algorithm/shuffle.h | ||
---|---|---|
24 | Commit message typo: identially | |
25 | Missing .clang-format updates and VisibilityMacros.rst changes? |
Yeah, I feel like there might have been some reason for the separate macros, but I can't remember anymore, and a git search didn't find anything relevant. Consolidating them makes sense to me.
How come you're not removing the _LIBCPP_EXCEPTION_ABI definition in __config as well?
https://github.com/llvm/llvm-project/blob/main/libcxx/docs/DesignDocs/VisibilityMacros.rst should be updated as part of this change.
For the record, the need for different macros comes from Windows which, in the past, has needed to distinguish between types, functions, exported things, and imported things when using dllimport/export semantics. Especially during the DLL build.
But if we don't need to support that, good riddance.
libcxx/include/__config | ||
---|---|---|
535 | This dead code show why the multiple macros were needed. Though it seems like this code has been broken since these large refactoring started. They're also more important during the DLL build than when using the DLL. When you're using the DLL, they all get defined the same. When you're building the DLL, things are a lot trickier. We should be clear that we've dropped support for a DLL build on Windows. |
Commit message typo: identially