[clang-tools-extra] 32f1029 - [clangd] Track performance of IncludeCleaner
Kirill Bobyrev via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 29 03:59:43 PDT 2021
Author: Kirill Bobyrev
Date: 2021-10-29T12:59:22+02:00
New Revision: 32f102912493db3df864cc80d5bb602962839f68
URL: https://github.com/llvm/llvm-project/commit/32f102912493db3df864cc80d5bb602962839f68
DIFF: https://github.com/llvm/llvm-project/commit/32f102912493db3df864cc80d5bb602962839f68.diff
LOG: [clangd] Track performance of IncludeCleaner
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D112783
Added:
Modified:
clang-tools-extra/clangd/IncludeCleaner.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/IncludeCleaner.cpp b/clang-tools-extra/clangd/IncludeCleaner.cpp
index 26ae356e243e9..240eb864d087c 100644
--- a/clang-tools-extra/clangd/IncludeCleaner.cpp
+++ b/clang-tools-extra/clangd/IncludeCleaner.cpp
@@ -197,6 +197,7 @@ bool mayConsiderUnused(const Inclusion *Inc) {
} // namespace
ReferencedLocations findReferencedLocations(ParsedAST &AST) {
+ trace::Span Tracer("IncludeCleaner::findReferencedLocations");
ReferencedLocations Result;
ReferencedLocationCrawler Crawler(Result);
Crawler.TraverseAST(AST.getASTContext());
@@ -225,6 +226,7 @@ findReferencedFiles(const llvm::DenseSet<SourceLocation> &Locs,
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 @@ llvm::DenseSet<IncludeStructure::HeaderID>
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) {
@@ -279,6 +282,7 @@ std::vector<const Inclusion *> computeUnusedIncludes(ParsedAST &AST) {
std::vector<Diag> issueUnusedIncludesDiagnostics(ParsedAST &AST,
llvm::StringRef Code) {
+ trace::Span Tracer("IncludeCleaner::issueUnusedIncludesDiagnostics");
const Config &Cfg = Config::current();
if (Cfg.Diagnostics.UnusedIncludes != Config::UnusedIncludesPolicy::Strict ||
Cfg.Diagnostics.SuppressAll ||
More information about the cfe-commits
mailing list