-
Notifications
You must be signed in to change notification settings - Fork 569
Adding DCE integration tests in compiler #1343
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
Conversation
b148802
to
f565ca5
Compare
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.
Thanks, this is excellent work! Some test cases revealed DCE behavior that was surprising, even though it made sense in the end.
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.
Overall I'm happy with this PR. If you don't think that generating stable identifiers for Decls is worth it, I'll merge it as-is.
This adds tests for the dead-code elimination (DCE) package into the compiler. The compiler performs many tasks that are related to DCE such as setting Decl's names and dependencies. These tests are designed like an integration test to ensure that the correct information is being given to the DCE and that the DCE is doing the correct things with that information.
This will introduce some TODO's that are resolved by the next part #1340. These TODO's exemplify the changes needed to be made to the DCE to properly handle generics and type instances. Double check that I'm not taking crazy pills with these TODO's and that they make sense to be the thing that needs to be fixed in the next part.
This is related to #1013 and #1270
🍰 As an added bonus; I upgraded the existing test to stop using the deprecated
golang.org/x/tools/go/loader
and instead start usinggolang.org/x/tools/go/packages
. It's nothing that exciting since it only is for source code for strings, but it's a start 😄