[PATCH] D71880: [clangd] Implement Decl canonicalization rules for rename

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 25 14:16:57 PST 2019


kbobyrev created this revision.
Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.

This patch introduces new canonicalization rules which are used for AST-based
rename in Clangd. By comparing two canonical declarations of inspected nodes,
Clangd determines whether both of them belong to the same entity user would
like to rename. Such functionality is relatively concise compared to the
Clang-Rename API that is used right now. It also helps to overcome the
limitations that Clang-Rename originally had and helps to eliminate several
classes of bugs.

Clangd AST-based rename currently relies on Clangd-Rename functionality, which
has a better test coverage and hence provides some correctness guarantees. This
pattch decouples two rename features and therefore introduces new challenges to
the Clangd maintenance. To prevent regressions and improve stability of Clangd
rename feature, there are new unittests that come with this change.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71880

Files:
  clang-tools-extra/clangd/refactor/Rename.cpp
  clang-tools-extra/clangd/unittests/RenameTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71880.235296.patch
Type: text/x-patch
Size: 7689 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191225/2aa22f83/attachment.bin>


More information about the cfe-commits mailing list