-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add some comments in check that required some reverse engineering #4780
base: trunk
Are you sure you want to change the base?
Conversation
Hopefully these make sense, I had saved these in a branch a while ago, and thought I should do something with them. |
While reading check I had to figure some things out that were not trivial, and I saved them with comments.
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.
This looks good to me, but I'm not familiar with the code in question, so it'd probably be good for Jon to verify that these comments capture the intent.
Co-authored-by: Jon Ross-Perkins <[email protected]>
@@ -31,6 +31,8 @@ struct PackageImports { | |||
: package_id(package_id), node_id(node_id) {} | |||
|
|||
// The identifier of the imported package. | |||
// | |||
// The current package uses the `IdentifierId::Invalid` id. |
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.
This semantic isn't specific to CheckUnit. It's in check.cpp, PackagingNames, SemIR::File, etc. I don't think it makes sense to start documenting separately in every place. Maybe it'd be better to find a central way to document this? You could probably add an alias if you prefer (or, PackagingNames is what it all stems from, so it could just be commented there).
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.
To be sure, with an alias, I'm thinking something like a documenting IdentifierId::DefaultPackage or something. But we already have LibraryNameId, so another option would be to add a similar PackageIdentifierId type.
While reading check I had to figure some things out that were not trivial, and I saved them with comments.