Skip rename_symbolt::rename when maps are empty#8974
Open
tautschnig wants to merge 1 commit intodiffblue:developfrom
Open
Skip rename_symbolt::rename when maps are empty#8974tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig wants to merge 1 commit intodiffblue:developfrom
Conversation
rename_symbolt::rename(exprt) creates a depth_iterator and walks the entire expression tree even when both expr_map and type_map are empty. This happens during library linking when no symbols need renaming. Add an early return to avoid the wasted traversal. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Avoids an unnecessary full expression-tree traversal in rename_symbolt::rename(exprt&) when there are no renaming rules, improving library-link-time performance in no-op cases.
Changes:
- Add an early return in
rename_symbolt::rename(exprt&)when bothexpr_mapandtype_mapare empty.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #8974 +/- ##
===========================================
+ Coverage 80.50% 80.51% +0.01%
===========================================
Files 1704 1704
Lines 188778 188779 +1
Branches 73 73
===========================================
+ Hits 151975 151995 +20
+ Misses 36803 36784 -19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
rename_symbolt::rename(exprt) creates a depth_iterator and walks the entire expression tree even when both expr_map and type_map are empty. This happens during library linking when no symbols need renaming. Add an early return to avoid the wasted traversal.