-
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
Move import refs to their own block. #4103
Conversation
Depends on #4101 |
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.
Wow, I really like this... LG!!
toolchain/check/import_ref.cpp
Outdated
// visible in textual IR. Adding it to the file block is arbitrary but is the | ||
// best place we have right now. |
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.
Should we also remove the last line of this comment?
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.
The comment in context.h was copying the important bits, I'd meant to remove this. So I've cut the detail out since it's now on the vector.
89f8416
to
f35f5c1
Compare
The use of ArrayStack here is intended to simplify the logic, and also make better use of the inst heap allocations. Prior changes #4101 and #4103 removed the less related logic from InstBlockStack, although #4103 is the actual part that blocked using ArrayStack. BTW, note the PrintForStackDump implementation was incorrect because it didn't apply size_. This simplification fixes the issue.
This executes on a TODO in AddImportRef to add instructions to their own block instead of the File block. This has an important consequence of removing a pattern from InstBlockStack that added to blocks not currently at the top, cleaning up an issue for ArrayStack. The delta here is then mostly in different formatting of the import refs, a consequence of the separation.