-
Notifications
You must be signed in to change notification settings - Fork 627
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
[Fix] External struct equality #27902
Conversation
The parsing of composite types will always be ambiguous in the sense that there is no way to know whether it is a struct or a record. This PR makes it so that all composites are parsed as having no program of origin. The ambiguity is resolved because after ST creator pass no two composites can share the same name, even if one is a record and the other is a struct. This means that the ST lookup_struct function can search again with program name set to the local program if it fails to find a record because the type indicated that its program of origin is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fairly large PR so reviewing in stages for manageability.
My main questions are:
- do we need all of the additional clones?
- why is does the program name need to be removed?
- is see a number of files where the generated bytecode has changed. Is this expected?
One immediate TODO is add back in the removed errors and regen expectations. This will reduce a lot of the files changed.
tests/expectations/compiler/records/record_declaration_out_of_order.out
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## testnet3 #27902 +/- ##
============================================
+ Coverage 76.95% 77.06% +0.10%
============================================
Files 205 204 -1
Lines 7200 7158 -42
Branches 7200 7158 -42
============================================
- Hits 5541 5516 -25
+ Misses 1659 1642 -17 ☔ View full report in Codecov by Sentry. |
I initially made this choice to allow the ST to compare struct equality using
All of these changes are because the records and structs defined are unused. I am going to change the tests so that the composites are used, since the point of those tests is to test behavior of composites. Another possibility is to only remove unused structs when DCE is on. Or to default remove redefinitions of unused external structs, and adhere to the DCE flag otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice work!
Resolves #27900