[PATCH] D119842: [clangd] NFC: Cleanup IncludeCleaner API
Kirill Bobyrev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 8 04:43:50 PST 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd5106c8f973b: [clangd] NFC: Cleanup IncludeCleaner API (authored by kbobyrev).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119842/new/
https://reviews.llvm.org/D119842
Files:
clang-tools-extra/clangd/IncludeCleaner.cpp
clang-tools-extra/clangd/IncludeCleaner.h
Index: clang-tools-extra/clangd/IncludeCleaner.h
===================================================================
--- clang-tools-extra/clangd/IncludeCleaner.h
+++ clang-tools-extra/clangd/IncludeCleaner.h
@@ -51,8 +51,7 @@
/// - don't attempt to describe where symbols were referenced from in
/// ambiguous cases (e.g. implicitly used symbols, multiple declarations)
/// - err on the side of reporting all possible locations
-ReferencedLocations findReferencedLocations(const SourceManager &SM,
- ASTContext &Ctx, Preprocessor &PP,
+ReferencedLocations findReferencedLocations(ASTContext &Ctx, Preprocessor &PP,
const syntax::TokenBuffer *Tokens);
ReferencedLocations findReferencedLocations(ParsedAST &AST);
Index: clang-tools-extra/clangd/IncludeCleaner.cpp
===================================================================
--- clang-tools-extra/clangd/IncludeCleaner.cpp
+++ clang-tools-extra/clangd/IncludeCleaner.cpp
@@ -286,11 +286,11 @@
} // namespace
-ReferencedLocations findReferencedLocations(const SourceManager &SM,
- ASTContext &Ctx, Preprocessor &PP,
+ReferencedLocations findReferencedLocations(ASTContext &Ctx, Preprocessor &PP,
const syntax::TokenBuffer *Tokens) {
trace::Span Tracer("IncludeCleaner::findReferencedLocations");
ReferencedLocations Result;
+ const auto &SM = Ctx.getSourceManager();
ReferencedLocationCrawler Crawler(Result, SM);
Crawler.TraverseAST(Ctx);
if (Tokens)
@@ -299,8 +299,8 @@
}
ReferencedLocations findReferencedLocations(ParsedAST &AST) {
- return findReferencedLocations(AST.getSourceManager(), AST.getASTContext(),
- AST.getPreprocessor(), &AST.getTokens());
+ return findReferencedLocations(AST.getASTContext(), AST.getPreprocessor(),
+ &AST.getTokens());
}
ReferencedFiles
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119842.413766.patch
Type: text/x-patch
Size: 2009 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220308/6d4cb85b/attachment-0001.bin>
More information about the cfe-commits
mailing list