This is an archive of the discontinued LLVM Phabricator instance.


Authored by Mordante on Feb 7 2023, 6:04 AM.
This is a draft revision that has not yet been submitted for review.



As discussed in D136775.

Diff Detail

Event Timeline

Mordante created this revision.Feb 7 2023, 6:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2023, 6:04 AM
Mordante added inline comments.Feb 7 2023, 6:08 AM

I think it would be good to document what should and what should not be hidden from the ABI.
For example should this implementation field use an ABI tag or not.
Then we probably should update too and if possible have some more clang-tidy validations.

I think I like this approach, but we should discuss it in the context of D153658. Also, I think we want to punt this change to LLVM 18, I don't believe we're blocking ourselves from anything if we wait.


I think that whatever we put an ABI tag on would also need to have hidden visibility. Otherwise, it is possible for users to start exporting symbols whose name depends on the libc++ version on their dylib boundaries, which is not good.

ldionne added inline comments.Tue, Nov 28, 8:27 AM

I think it would be useful to add this attribute to a few other internal-only types that are not meant to appear at ABI boundaries, just to make it clear how this attribute is intended to be used. A good candidate would be libcxx/include/__utility/exception_guard.h.


This documentation needs to touch on the fact that we don't have a way to enforce that these types are not used at ABI boundaries, but that if it happens in e.g. a function signature the ABI break will be quite loud because the mangling of the type changes with the ODR signature (which includes e.g. the version of the library).

We should also say that it's fine to use these types as return types and parameter types of functions, but only if said functions are marked as HIDE_FROM_ABI.

We should also say that such types must never be used as a member of another type, except if that other type is *also* marked as HIDE_FROM_ABI_TYPE.


I think I would do this now: