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

[NFC] Clean up Literal copy constructor #6841

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

kripken
Copy link
Member

@kripken kripken commented Aug 14, 2024

Diff without whitespace is smaller.

  • HeapType::ext was handled in two places. The second place was wrong, but not reached.
  • Near the end all we have left are refs, so no need to check isRef etc.
  • Simplify the code to get the heap type once.

@kripken kripken requested a review from tlively August 14, 2024 20:53
Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we really wanted big simplicity wins here, we could use std::variant and get rid of all our custom copy constructors, destructors, etc.

@kripken
Copy link
Member Author

kripken commented Aug 15, 2024

Agreed that a larger cleanup to std::variant might make sense eventually. Literal is some of the oldest/most basic code in Binaryen, from long before we supported C++17 or C++17 even existed...

@kripken kripken merged commit d567578 into WebAssembly:main Aug 15, 2024
13 checks passed
@kripken kripken deleted the nfc.literal.copy branch August 15, 2024 17:27
@gkdn gkdn mentioned this pull request Aug 31, 2024
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 this pull request may close these issues.

2 participants