diff --git a/clang/include/clang/Frontend/Utils.h b/clang/include/clang/Frontend/Utils.h --- a/clang/include/clang/Frontend/Utils.h +++ b/clang/include/clang/Frontend/Utils.h @@ -32,12 +32,6 @@ #include #include -namespace llvm { - -class Triple; - -} // namespace llvm - namespace clang { class ASTReader; @@ -46,20 +40,11 @@ class DiagnosticsEngine; class ExternalSemaSource; class FrontendOptions; -class HeaderSearch; -class HeaderSearchOptions; -class LangOptions; class PCHContainerReader; class Preprocessor; class PreprocessorOptions; class PreprocessorOutputOptions; -/// Apply the header search options to get given HeaderSearch object. -void ApplyHeaderSearchOptions(HeaderSearch &HS, - const HeaderSearchOptions &HSOpts, - const LangOptions &Lang, - const llvm::Triple &triple); - /// InitializePreprocessor - Initialize the preprocessor getting it and the /// environment ready to process a single file. void InitializePreprocessor(Preprocessor &PP, const PreprocessorOptions &PPOpts, diff --git a/clang/include/clang/Lex/HeaderSearch.h b/clang/include/clang/Lex/HeaderSearch.h --- a/clang/include/clang/Lex/HeaderSearch.h +++ b/clang/include/clang/Lex/HeaderSearch.h @@ -34,6 +34,12 @@ #include #include +namespace llvm { + +class Triple; + +} // namespace llvm + namespace clang { class DiagnosticsEngine; @@ -853,6 +859,12 @@ bool IsSystem, bool IsFramework); }; +/// Apply the header search options to get given HeaderSearch object. +void ApplyHeaderSearchOptions(HeaderSearch &HS, + const HeaderSearchOptions &HSOpts, + const LangOptions &Lang, + const llvm::Triple &triple); + } // namespace clang #endif // LLVM_CLANG_LEX_HEADERSEARCH_H diff --git a/clang/lib/Frontend/CMakeLists.txt b/clang/lib/Frontend/CMakeLists.txt --- a/clang/lib/Frontend/CMakeLists.txt +++ b/clang/lib/Frontend/CMakeLists.txt @@ -24,7 +24,6 @@ FrontendActions.cpp FrontendOptions.cpp HeaderIncludeGen.cpp - InitHeaderSearch.cpp InitPreprocessor.cpp LayoutOverrideSource.cpp LogDiagnosticPrinter.cpp diff --git a/clang/lib/Lex/CMakeLists.txt b/clang/lib/Lex/CMakeLists.txt --- a/clang/lib/Lex/CMakeLists.txt +++ b/clang/lib/Lex/CMakeLists.txt @@ -6,6 +6,7 @@ DependencyDirectivesSourceMinimizer.cpp HeaderMap.cpp HeaderSearch.cpp + InitHeaderSearch.cpp Lexer.cpp LiteralSupport.cpp MacroArgs.cpp diff --git a/clang/lib/Frontend/InitHeaderSearch.cpp b/clang/lib/Lex/InitHeaderSearch.cpp rename from clang/lib/Frontend/InitHeaderSearch.cpp rename to clang/lib/Lex/InitHeaderSearch.cpp --- a/clang/lib/Frontend/InitHeaderSearch.cpp +++ b/clang/lib/Lex/InitHeaderSearch.cpp @@ -10,11 +10,10 @@ // //===----------------------------------------------------------------------===// +#include "clang/Basic/DiagnosticFrontend.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/LangOptions.h" #include "clang/Config/config.h" // C_INCLUDE_DIRS -#include "clang/Frontend/FrontendDiagnostic.h" -#include "clang/Frontend/Utils.h" #include "clang/Lex/HeaderMap.h" #include "clang/Lex/HeaderSearch.h" #include "clang/Lex/HeaderSearchOptions.h" diff --git a/clang/unittests/Lex/CMakeLists.txt b/clang/unittests/Lex/CMakeLists.txt --- a/clang/unittests/Lex/CMakeLists.txt +++ b/clang/unittests/Lex/CMakeLists.txt @@ -15,7 +15,6 @@ PRIVATE clangAST clangBasic - clangFrontend clangLex clangParse clangSema diff --git a/clang/unittests/Lex/HeaderSearchTest.cpp b/clang/unittests/Lex/HeaderSearchTest.cpp --- a/clang/unittests/Lex/HeaderSearchTest.cpp +++ b/clang/unittests/Lex/HeaderSearchTest.cpp @@ -15,8 +15,6 @@ #include "clang/Basic/SourceManager.h" #include "clang/Basic/TargetInfo.h" #include "clang/Basic/TargetOptions.h" -#include "clang/Frontend/Utils.h" -#include "clang/Lex/HeaderSearch.h" #include "clang/Lex/HeaderSearchOptions.h" #include "clang/Serialization/InMemoryModuleCache.h" #include "llvm/Support/MemoryBuffer.h"