Skip to content

Commit

Permalink
[clangd][unittests][IncludeCleaner] Don't call findReferencedFiles() …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
ArcsinX committed Aug 12, 2022
1 parent b559777 commit 42ee0d8
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp
Expand Up @@ -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());
}
Expand All @@ -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.
Expand Down

0 comments on commit 42ee0d8

Please sign in to comment.