aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra
diff options
context:
space:
mode:
authorAleksandr Platonov <platonov.aleksandr@huawei.com>2022-08-12 20:59:49 +0300
committerAleksandr Platonov <platonov.aleksandr@huawei.com>2022-08-12 21:00:11 +0300
commit42ee0d8c16f7052c3bc8434325868f48a501baf2 (patch)
treed32447caa596dea1ef00a8b39f2402ccab826093 /clang-tools-extra
parentb559777c308dcdf40a5dc8dffd35867083a46c3c (diff)
downloadllvm-42ee0d8c16f7052c3bc8434325868f48a501baf2.zip
llvm-42ee0d8c16f7052c3bc8434325868f48a501baf2.tar.gz
llvm-42ee0d8c16f7052c3bc8434325868f48a501baf2.tar.bz2
[clangd][unittests][IncludeCleaner] Don't call findReferencedFiles() if the result is not used
IncludeCleaner.RecursiveInclusion and IncludeCleaner.IWYUPragmaExport tests don't check referenced files list, so we don't need to call findReferencedFiles() there. Reviewed By: kbobyrev Differential Revision: https://reviews.llvm.org/D131706
Diffstat (limited to 'clang-tools-extra')
-rw-r--r--clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp b/clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp
index 527db2a..d79f121 100644
--- a/clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp
+++ b/clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp
@@ -571,9 +571,6 @@ TEST(IncludeCleaner, RecursiveInclusion) {
)cpp");
ParsedAST AST = TU.build();
- auto ReferencedFiles = findReferencedFiles(
- findReferencedLocations(AST), AST.getIncludeStructure(),
- AST.getCanonicalIncludes(), AST.getSourceManager());
EXPECT_THAT(AST.getDiagnostics(), llvm::ValueIs(IsEmpty()));
EXPECT_THAT(computeUnusedIncludes(AST), IsEmpty());
}
@@ -596,9 +593,6 @@ TEST(IncludeCleaner, IWYUPragmaExport) {
)cpp");
ParsedAST AST = TU.build();
- auto ReferencedFiles = findReferencedFiles(
- findReferencedLocations(AST), AST.getIncludeStructure(),
- AST.getCanonicalIncludes(), AST.getSourceManager());
EXPECT_THAT(AST.getDiagnostics(), llvm::ValueIs(IsEmpty()));
// FIXME: This is not correct: foo.h is unused but is not diagnosed as such
// because we ignore headers with IWYU export pragmas for now.