diff --git a/clang-tools-extra/include-cleaner/include/clang-include-cleaner/Analysis.h b/clang-tools-extra/include-cleaner/include/clang-include-cleaner/Analysis.h --- a/clang-tools-extra/include-cleaner/include/clang-include-cleaner/Analysis.h +++ b/clang-tools-extra/include-cleaner/include/clang-include-cleaner/Analysis.h @@ -12,12 +12,13 @@ #define CLANG_INCLUDE_CLEANER_ANALYSIS_H #include "clang-include-cleaner/Types.h" +#include "clang/Basic/SourceLocation.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/STLFunctionalExtras.h" #include namespace clang { -class SourceLocation; +class ASTContext; class Decl; class FileEntry; namespace include_cleaner { @@ -46,6 +47,10 @@ /// (e.g. IWYU pragmas). void walkUsed(llvm::ArrayRef ASTRoots, UsedSymbolCB CB); +// Write an HTML summary of the analysis to the given stream. +void writeHTMLReport(FileID File, llvm::ArrayRef Roots, ASTContext &Ctx, + llvm::raw_ostream &OS); + } // namespace include_cleaner } // namespace clang diff --git a/clang-tools-extra/include-cleaner/lib/AnalysisInternal.h b/clang-tools-extra/include-cleaner/lib/AnalysisInternal.h --- a/clang-tools-extra/include-cleaner/lib/AnalysisInternal.h +++ b/clang-tools-extra/include-cleaner/lib/AnalysisInternal.h @@ -25,7 +25,6 @@ #include "llvm/ADT/STLFunctionalExtras.h" namespace clang { -class ASTContext; class Decl; class NamedDecl; namespace include_cleaner { @@ -42,11 +41,6 @@ /// being analyzed, in order to find all references within it. void walkAST(Decl &Root, llvm::function_ref); -/// Write an HTML summary of the analysis to the given stream. -/// FIXME: Once analysis has a public API, this should be public too. -void writeHTMLReport(FileID File, llvm::ArrayRef Roots, ASTContext &Ctx, - llvm::raw_ostream &OS); - } // namespace include_cleaner } // namespace clang diff --git a/clang-tools-extra/include-cleaner/lib/HTMLReport.cpp b/clang-tools-extra/include-cleaner/lib/HTMLReport.cpp --- a/clang-tools-extra/include-cleaner/lib/HTMLReport.cpp +++ b/clang-tools-extra/include-cleaner/lib/HTMLReport.cpp @@ -14,6 +14,7 @@ //===----------------------------------------------------------------------===// #include "AnalysisInternal.h" +#include "clang-include-cleaner/Analysis.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" #include "clang/AST/PrettyPrinter.h" diff --git a/clang-tools-extra/include-cleaner/tool/CMakeLists.txt b/clang-tools-extra/include-cleaner/tool/CMakeLists.txt --- a/clang-tools-extra/include-cleaner/tool/CMakeLists.txt +++ b/clang-tools-extra/include-cleaner/tool/CMakeLists.txt @@ -1,6 +1,5 @@ set(LLVM_LINK_COMPONENTS Support) -include_directories("../lib") # FIXME: use public APIs instead. add_clang_tool(clang-include-cleaner IncludeCleaner.cpp) clang_target_link_libraries(clang-include-cleaner PRIVATE clangBasic diff --git a/clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp b/clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp --- a/clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp +++ b/clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "AnalysisInternal.h" +#include "clang-include-cleaner/Analysis.h" #include "clang-include-cleaner/Record.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Frontend/FrontendAction.h"