Adding DCE integration tests in compiler#1343
Merged
nevkontakte merged 3 commits intogopherjs:masterfrom Oct 16, 2024
Merged
Conversation
b148802 to
f565ca5
Compare
nevkontakte
requested changes
Oct 9, 2024
Member
nevkontakte
left a comment
There was a problem hiding this comment.
Thanks, this is excellent work! Some test cases revealed DCE behavior that was surprising, even though it made sense in the end.
nevkontakte
approved these changes
Oct 15, 2024
Member
nevkontakte
left a comment
There was a problem hiding this comment.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/loaderand 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 😄