Skip to content
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

Merged
merged 3 commits into from
Jul 3, 2024

Conversation

jonmeow
Copy link
Contributor

@jonmeow jonmeow commented Jul 2, 2024

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.

@jonmeow
Copy link
Contributor Author

jonmeow commented Jul 2, 2024

Depends on #4101

Copy link
Contributor

@chandlerc chandlerc left a 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!!

Comment on lines 68 to 69
// visible in textual IR. Adding it to the file block is arbitrary but is the
// best place we have right now.
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@jonmeow jonmeow enabled auto-merge July 3, 2024 18:12
@jonmeow jonmeow added this pull request to the merge queue Jul 3, 2024
Merged via the queue into carbon-language:trunk with commit 9581a18 Jul 3, 2024
7 checks passed
@jonmeow jonmeow deleted the imports-refs-block branch July 3, 2024 18:32
github-merge-queue bot pushed a commit that referenced this pull request Jul 3, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants