Skip to content

Skip rename_symbolt::rename when maps are empty#8974

Open
tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig:skip-rename
Open

Skip rename_symbolt::rename when maps are empty#8974
tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig:skip-rename

Conversation

@tautschnig
Copy link
Copy Markdown
Collaborator

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.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

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>
@tautschnig tautschnig self-assigned this Apr 27, 2026
Copilot AI review requested due to automatic review settings April 27, 2026 10:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 both expr_map and type_map are empty.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.51%. Comparing base (b32074b) to head (43da1bc).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants