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

Support arrays in structs #24

Merged
merged 4 commits into from
Aug 27, 2024
Merged

Support arrays in structs #24

merged 4 commits into from
Aug 27, 2024

Conversation

wpmed92
Copy link
Owner

@wpmed92 wpmed92 commented Aug 27, 2024

  • Support parsing MemberAccessExpressions that also contain ArrayAccessExpressions: myStruct.myArrayMember[idx]
  • Add code generation for structs with array member
  • Fix ->isLhs() hacks: push pointers to expression stack, and load them when they are used. The new load method checks if the value is a pointer, and loads if it is. This simplifies the code a lot, as there's no need the determine if the value will be used as pointer, or as a loaded value at op creation time, only at the time of actual usage.
  • CompositeExtract is now AccessChain: to unify the code both member access and array access are implemented using AccessChain
  • Various cleanups
  • structs tests have been updated to test the new array-access-in-member-access feature, they also test advanced indexing, such as member access used as an index

@wpmed92 wpmed92 changed the title Arr in struct Array struct member Aug 27, 2024
@wpmed92 wpmed92 changed the title Array struct member Support arrays in structs Aug 27, 2024
@wpmed92 wpmed92 merged commit ecd5e52 into main Aug 27, 2024
1 check passed
@wpmed92 wpmed92 deleted the arr-in-struct branch August 27, 2024 16:07
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.

1 participant