[PATCH] D112783: [clangd] Track performance of IncludeCleaner
Kirill Bobyrev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 29 01:41:22 PDT 2021
kbobyrev created this revision.
kbobyrev added a reviewer: kadircet.
Herald added subscribers: usaxena95, arphaman.
kbobyrev requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D112783
Files:
clang-tools-extra/clangd/IncludeCleaner.cpp
Index: clang-tools-extra/clangd/IncludeCleaner.cpp
===================================================================
--- clang-tools-extra/clangd/IncludeCleaner.cpp
+++ clang-tools-extra/clangd/IncludeCleaner.cpp
@@ -197,6 +197,7 @@
} // namespace
ReferencedLocations findReferencedLocations(ParsedAST &AST) {
+ trace::Span Tracer("IncludeCleaner::findReferencedLocations");
ReferencedLocations Result;
ReferencedLocationCrawler Crawler(Result);
Crawler.TraverseAST(AST.getASTContext());
@@ -225,6 +226,7 @@
std::vector<const Inclusion *>
getUnused(const IncludeStructure &Includes,
const llvm::DenseSet<IncludeStructure::HeaderID> &ReferencedFiles) {
+ trace::Span Tracer("IncludeCleaner::getUnused");
std::vector<const Inclusion *> Unused;
for (const Inclusion &MFI : Includes.MainFileIncludes) {
// FIXME: Skip includes that are not self-contained.
@@ -253,6 +255,7 @@
translateToHeaderIDs(const llvm::DenseSet<FileID> &Files,
const IncludeStructure &Includes,
const SourceManager &SM) {
+ trace::Span Tracer("IncludeCleaner::translateToHeaderIDs");
llvm::DenseSet<IncludeStructure::HeaderID> TranslatedHeaderIDs;
TranslatedHeaderIDs.reserve(Files.size());
for (FileID FID : Files) {
@@ -269,6 +272,7 @@
}
std::vector<const Inclusion *> computeUnusedIncludes(ParsedAST &AST) {
+ trace::Span Tracer("IncludeCleaner::computeUnusedIncludes");
const auto &SM = AST.getSourceManager();
auto Refs = findReferencedLocations(AST);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112783.383255.patch
Type: text/x-patch
Size: 1535 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211029/a6c04c3a/attachment.bin>
More information about the cfe-commits
mailing list