Skip to content

Commit 118f783

Browse files
committed
[clang-rename] Respect the traversal scope when traversing the entire AST.
Summary: This should be NFC to clang-rename, by default the traversal scope is TUDecl. Traversing the TUDecl in clangd is a performance cliff, we should avoid it. Reviewers: ilya-biryukov Subscribers: kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69892
1 parent 5b9a072 commit 118f783

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class AdditionalUSRFinder : public RecursiveASTVisitor<AdditionalUSRFinder> {
6767

6868
std::vector<std::string> Find() {
6969
// Fill OverriddenMethods and PartialSpecs storages.
70-
TraverseDecl(Context.getTranslationUnitDecl());
70+
TraverseAST(Context);
7171
if (const auto *MethodDecl = dyn_cast<CXXMethodDecl>(FoundDecl)) {
7272
addUSRsOfOverridenFunctions(MethodDecl);
7373
for (const auto &OverriddenMethod : OverriddenMethods) {

0 commit comments

Comments
 (0)