Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: document or somehow notice __cxa_init_primary_exception #173

Open
itrofimow opened this issue Nov 27, 2023 · 3 comments · May be fixed by #176
Open

Proposal: document or somehow notice __cxa_init_primary_exception #173

itrofimow opened this issue Nov 27, 2023 · 3 comments · May be fixed by #176

Comments

@itrofimow
Copy link

Hi!

This comes from std::make_exception_ptr: instead of doing throw + catch dance it is possible to initialize the exception object directly, and gcc does that via ABI-extension for almost a decade: https://github.com/gcc-mirror/gcc/blob/8b9d0e8cf482287b6c37b5a268d0eb2d0a964561/libstdc%2B%2B-v3/libsupc%2B%2B/cxxabi_init_exception.h#L70

I've recently landed the same ABI-extension into libcxxrt (https://github.com/libcxxrt/libcxxrt/blob/03c83f5a57be8c5b1a29a68de5638744f17d28ba/src/cxxabi.h#L211) and right now I'm in the process of implementing exactly the same std::make_exception_ptr optimization in LLVM, which implies adding __cxa_init_primary_exception into libcxxabi.

So i though it would make sense to document this function as some kind of auxiliary API, since 3 major implementation are all (hopefully) about to have this as an extension.

Does that sound reasonable?

@itrofimow
Copy link
Author

Related:
libcxxrt: libcxxrt/libcxxrt#23
libcxxabi: llvm/llvm-project#65534

@rjmccall
Copy link
Collaborator

Yeah, I think if you want to write up a patch for this, it'd be a totally welcome addition to the ABI specification.

@itrofimow
Copy link
Author

I'm planing to give this another try, but for now i'm a bit too busy, unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants