Skip to content

Remove the unused StmtClone clone mapping. NFC - #1910

Merged
vgvassilev merged 1 commit into
masterfrom
remove-dead-stmtclone-mapping
Jul 20, 2026
Merged

Remove the unused StmtClone clone mapping. NFC#1910
vgvassilev merged 1 commit into
masterfrom
remove-dead-stmtclone-mapping

Conversation

@vgvassilev

Copy link
Copy Markdown
Owner

StmtCloneMapping recorded, for each cloned Stmt and VarDecl, the original it came from. Nothing ever read either map, and no caller passed a mapping in the first place -- the sole StmtClone is constructed without one -- so m_OriginalToClonedStmts was permanently null and both writes were dead.

Drop the struct, the member, the typedefs and the two writes. Cloning that must remap references to its clones does so through m_DeclReplacements, which the callers already maintain.

StmtCloneMapping recorded, for each cloned Stmt and VarDecl, the original
it came from. Nothing ever read either map, and no caller passed a
mapping in the first place -- the sole StmtClone is constructed without
one -- so m_OriginalToClonedStmts was permanently null and both writes
were dead.

Drop the struct, the member, the typedefs and the two writes. Cloning
that must remap references to its clones does so through
m_DeclReplacements, which the callers already maintain.
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@vgvassilev
vgvassilev merged commit d786da5 into master Jul 20, 2026
40 checks passed
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.

1 participant