Conversation
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jan 11, 2026
TomerStarkware
approved these changes
Jan 12, 2026
Collaborator
TomerStarkware
left a comment
There was a problem hiding this comment.
@TomerStarkware reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware).
7a719e0 to
63d2f2c
Compare
5ee68e9 to
0277b49
Compare
This was referenced Jan 13, 2026
Closed
Allocating less when taking old annotations. SIERRA_UPDATE_MINOR_CHANGE_TAG=No interface change.
63d2f2c to
d7e77ed
Compare
0277b49 to
836fae2
Compare
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.

Summary
Refactored the
take_annotationsmethod inProgramAnnotationsto simplify the logic for handling statement annotations. Instead of creating a temporary replacement and then swapping values, the method now takes ownership of the annotations entry directly, clones it if needed for backward jumps, and returns the modified entry.Type of change
Please check one:
Why is this change needed?
The previous implementation of
take_annotationswas unnecessarily complex, using multiple memory operations (replace, take) and creating temporary objects. This change simplifies the code flow and reduces memory operations by taking ownership of the annotation entry directly.What was the behavior or documentation before?
The method would retrieve a mutable reference to the annotations, create a temporary replacement, and use
std::mem::replaceandstd::mem::taketo swap values around.What is the behavior or documentation after?
The method now uses
take()to get ownership of the annotations directly, clones them only when necessary (for backward jumps), and returns the modified entry without unnecessary memory operations.Additional context
This change maintains the same functionality while making the code more straightforward and potentially more efficient by reducing memory operations and temporary object creation.