This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Filter out implicit references while renaming
ClosedPublic

Authored by kbobyrev on Feb 6 2020, 12:14 AM.

Details

Summary

This patch is based on D72746 and prevents non-spelled references from
being renamed which would cause incorrect behavior otherwise.

Diff Detail

Event Timeline

kbobyrev created this revision.Feb 6 2020, 12:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 6 2020, 12:14 AM
hokein accepted this revision.Feb 6 2020, 12:21 AM

looks good, thanks.

clang-tools-extra/clangd/refactor/Rename.cpp
309

nit: I'd use if (!static_cast<int>(R.Kind & RefKind::Spelled)).

clang-tools-extra/clangd/unittests/RenameTests.cpp
913

nit: "only rename spelled references"

This revision is now accepted and ready to land.Feb 6 2020, 12:21 AM
kbobyrev updated this revision to Diff 242822.Feb 6 2020, 12:52 AM
kbobyrev marked 2 inline comments as done.

Address review comments.

This revision was automatically updated to reflect the committed changes.
hokein added a comment.Feb 6 2020, 6:06 AM

Address review comments.

looks like the code you submitted is the old version, not the one you addressed comments.