[clang-rename] improve USRFindingAction
authorKirill Bobyrev <omtcyfz@gmail.com>
Wed, 3 Aug 2016 23:00:32 +0000 (23:00 +0000)
committerKirill Bobyrev <omtcyfz@gmail.com>
Wed, 3 Aug 2016 23:00:32 +0000 (23:00 +0000)
commitd6ab7d4508f1bd0159a7d66179bdf78059b47f4f
tree48c37dd131388e26c370d350a89e8c271e21b12f
parent298de8f6a3698c46c538c37dcd8f84a87e2e4095
[clang-rename] improve USRFindingAction

1. Improve templated class renaming, namely add capabilities of finding partial
and full specializations. Every class partial specialization has reference to
the specialized class. Thus, storing all partial specializations and
comparing specialized class decls to the FoundDecl solves this. All full class
specializations can be found by calling ClassTemplateDecl::specializations().

2. Fix virtual function and its overriding functions renaming. Renaming a
virtual function requires renaming every other function in its "overriding
graph".

3. Merge TemplateClassInstantiationFindBy{Declaration|TypeUse}.cpp tests into
one test by adding multiple invocations of clang-rename to one test, because
the only different thing across these tests is -offset passed to clang-rename.

Reviewers: alexfh

Differential Revision: https://reviews.llvm.org/D23058

llvm-svn: 277663
clang-tools-extra/clang-rename/USRFinder.cpp
clang-tools-extra/clang-rename/USRFindingAction.cpp
clang-tools-extra/test/clang-rename/ComplexFunctionOverride.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-rename/TemplateClassInstantiation.cpp [moved from clang-tools-extra/test/clang-rename/TemplateClassInstantiationFindByDeclaration.cpp with 54% similarity]
clang-tools-extra/test/clang-rename/TemplateClassInstantiationFindByTypeUse.cpp [deleted file]