Skip to content

sema: add union alignment resolution #17658

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 3 commits into from
Oct 31, 2023

Conversation

kcbanner
Copy link
Contributor

This is just the union alignment changes extracted from #17490.

Changes:

  • Add resolveUnionAlignment, to resolve a union's alignment only, without triggering layout resolution.
  • Update resolveUnionLayout to cache size, alignment, and padding. abiSizeAdvanced and abiAlignmentAdvanced now use this information instead of computing it each time.

Copy link
Member

@mlugg mlugg left a comment

Choose a reason for hiding this comment

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

Actual logic looks good, a few minor comments.

@kcbanner kcbanner force-pushed the union_alignment_resolution branch from 1e6ecf8 to ac52cb9 Compare October 26, 2023 04:47
- Add resolveUnionAlignment, to resolve a union's alignment only, without triggering layout resolution.
- Update resolveUnionLayout to cache size, alignment, and padding. abiSizeAdvanced and abiAlignmentAdvanced
  now use this information instead of computing it each time.
@kcbanner kcbanner force-pushed the union_alignment_resolution branch from ac52cb9 to 0574643 Compare October 27, 2023 03:29
Copy link
Member

@mlugg mlugg left a comment

Choose a reason for hiding this comment

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

Nice work! I'd be happy to merge this, but I'll give it a couple days in case Andrew has any comments I've missed.

@mlugg mlugg merged commit 825da34 into ziglang:master Oct 31, 2023
@andrewrk
Copy link
Member

andrewrk commented Nov 1, 2023

@mlugg please prefer a --no-ff merge when there are multiple commits 🙏

image

@mlugg
Copy link
Member

mlugg commented Nov 1, 2023

Ah, okay, my bad!

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.

3 participants