Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
1 parent
298de8f
commit d6ab7d4
Showing
5 changed files
with
100 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
clang-tools-extra/test/clang-rename/ComplexFunctionOverride.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// RUN: cat %s > %t.cpp | ||
// RUN: clang-rename -offset=307 -new-name=bar %t.cpp -i -- -std=c++11 | ||
// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s | ||
|
||
struct A { | ||
virtual void foo(); // CHECK: virtual void bar(); | ||
}; | ||
|
||
struct B : A { | ||
void foo() override; // CHECK: void bar() override; | ||
}; | ||
|
||
struct C : B { | ||
void foo() override; // CHECK: void bar() override; | ||
}; | ||
|
||
struct D : B { | ||
void foo() override; // CHECK: void bar() override; | ||
}; | ||
|
||
struct E : D { | ||
void foo() override; // CHECK: void bar() override; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 0 additions & 44 deletions
44
clang-tools-extra/test/clang-rename/TemplateClassInstantiationFindByTypeUse.cpp
This file was deleted.
Oops, something went wrong.