Skip to content

Swift: replace getCanonicalPointer with std::variant #9172

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

Merged
merged 2 commits into from
May 16, 2022

Conversation

redsun82
Copy link
Contributor

This turned out easier than expected previously. llvm::PointerUnion
was also considered, which would have less memory footprint, but it
would require more effort as it is lacking the same implicit conversions
and operators that std::variant provides.

Also renamed ToTag<E> to TrapTagOf<E> and introduced a derived
convenience functor TrapLabelOf<E>.

This is a follow-up to #9112

This turned out easier than expected previously. `llvm::PointerUnion`
was also considered, which would have less memory footprint, but it
would require more effort as it is lacking the same implicit conversions
and operators that `std::variant` provides.

Also renamed `ToTag<E>` to `TrapTagOf<E>` and introduced a derived
convenience functor `TrapLabelOf<E>`.
@redsun82 redsun82 requested a review from sashabu May 16, 2022 08:04
@redsun82 redsun82 requested a review from a team as a code owner May 16, 2022 08:04
@github-actions github-actions bot added the Swift label May 16, 2022
@redsun82 redsun82 merged commit 9abb3f0 into main May 16, 2022
@redsun82 redsun82 deleted the redsun82/swift-variant-in-label-store branch May 16, 2022 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants