diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Frontend/ASTUnit.h | 20 | ||||
-rw-r--r-- | include/clang/Frontend/CompilerInvocation.h | 18 | ||||
-rw-r--r-- | include/clang/Lex/HeaderSearch.h | 12 | ||||
-rw-r--r-- | include/clang/Lex/HeaderSearchOptions.h (renamed from include/clang/Frontend/HeaderSearchOptions.h) | 7 |
4 files changed, 35 insertions, 22 deletions
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index c2bde120a0..d0fd48f24f 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -19,6 +19,7 @@ #include "clang/Sema/CodeCompleteConsumer.h" #include "clang/Lex/ModuleLoader.h" #include "clang/Lex/PreprocessingRecord.h" +#include "clang/Lex/HeaderSearchOptions.h" #include "clang/AST/ASTContext.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/SourceManager.h" @@ -63,15 +64,16 @@ class ASTDeserializationListener; /// class ASTUnit : public ModuleLoader { private: - IntrusiveRefCntPtr<LangOptions> LangOpts; - IntrusiveRefCntPtr<DiagnosticsEngine> Diagnostics; - IntrusiveRefCntPtr<FileManager> FileMgr; - IntrusiveRefCntPtr<SourceManager> SourceMgr; - OwningPtr<HeaderSearch> HeaderInfo; - IntrusiveRefCntPtr<TargetInfo> Target; - IntrusiveRefCntPtr<Preprocessor> PP; - IntrusiveRefCntPtr<ASTContext> Ctx; - IntrusiveRefCntPtr<TargetOptions> TargetOpts; + IntrusiveRefCntPtr<LangOptions> LangOpts; + IntrusiveRefCntPtr<DiagnosticsEngine> Diagnostics; + IntrusiveRefCntPtr<FileManager> FileMgr; + IntrusiveRefCntPtr<SourceManager> SourceMgr; + OwningPtr<HeaderSearch> HeaderInfo; + IntrusiveRefCntPtr<TargetInfo> Target; + IntrusiveRefCntPtr<Preprocessor> PP; + IntrusiveRefCntPtr<ASTContext> Ctx; + IntrusiveRefCntPtr<TargetOptions> TargetOpts; + IntrusiveRefCntPtr<HeaderSearchOptions> HSOpts; ASTReader *Reader; struct ASTWriterData; diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h index de8f60049a..5509e77a1b 100644 --- a/include/clang/Frontend/CompilerInvocation.h +++ b/include/clang/Frontend/CompilerInvocation.h @@ -14,12 +14,12 @@ #include "clang/Basic/TargetOptions.h" #include "clang/Basic/FileSystemOptions.h" #include "clang/Basic/DiagnosticOptions.h" +#include "clang/Lex/HeaderSearchOptions.h" #include "clang/StaticAnalyzer/Core/AnalyzerOptions.h" #include "clang/Frontend/MigratorOptions.h" #include "clang/Frontend/CodeGenOptions.h" #include "clang/Frontend/DependencyOutputOptions.h" #include "clang/Frontend/FrontendOptions.h" -#include "clang/Frontend/HeaderSearchOptions.h" #include "clang/Frontend/LangStandard.h" #include "clang/Frontend/PreprocessorOptions.h" #include "clang/Frontend/PreprocessorOutputOptions.h" @@ -59,6 +59,9 @@ protected: /// Options controlling the diagnostic engine. IntrusiveRefCntPtr<DiagnosticOptions> DiagnosticOpts; + /// Options controlling the \#include directive. + IntrusiveRefCntPtr<HeaderSearchOptions> HeaderSearchOpts; + public: CompilerInvocationBase(); @@ -73,6 +76,11 @@ public: } DiagnosticOptions &getDiagnosticOpts() const { return *DiagnosticOpts; } + + HeaderSearchOptions &getHeaderSearchOpts() { return *HeaderSearchOpts; } + const HeaderSearchOptions &getHeaderSearchOpts() const { + return *HeaderSearchOpts; + } }; /// \brief Helper class for holding the data necessary to invoke the compiler. @@ -98,9 +106,6 @@ class CompilerInvocation : public CompilerInvocationBase { /// Options controlling the frontend itself. FrontendOptions FrontendOpts; - /// Options controlling the \#include directive. - HeaderSearchOptions HeaderSearchOpts; - /// Options controlling the preprocessor (aside from \#include handling). PreprocessorOptions PreprocessorOpts; @@ -182,11 +187,6 @@ public: return FileSystemOpts; } - HeaderSearchOptions &getHeaderSearchOpts() { return HeaderSearchOpts; } - const HeaderSearchOptions &getHeaderSearchOpts() const { - return HeaderSearchOpts; - } - FrontendOptions &getFrontendOpts() { return FrontendOpts; } const FrontendOptions &getFrontendOpts() const { return FrontendOpts; diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h index 80a22f9c56..4334db771c 100644 --- a/include/clang/Lex/HeaderSearch.h +++ b/include/clang/Lex/HeaderSearch.h @@ -17,6 +17,7 @@ #include "clang/Lex/DirectoryLookup.h" #include "clang/Lex/ModuleMap.h" #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringSet.h" #include "llvm/Support/Allocator.h" @@ -29,6 +30,7 @@ class DiagnosticsEngine; class ExternalIdentifierLookup; class FileEntry; class FileManager; +class HeaderSearchOptions; class IdentifierInfo; /// \brief The preprocessor keeps track of this information for each @@ -131,6 +133,9 @@ class HeaderSearch { bool IsUserSpecifiedSystemFramework; }; + /// \brief Header-search options used to initialize this header search. + llvm::IntrusiveRefCntPtr<HeaderSearchOptions> HSOpts; + FileManager &FileMgr; /// \#include search path information. Requests for \#include "x" search the /// directory of the \#including file first, then each directory in SearchDirs @@ -212,10 +217,15 @@ class HeaderSearch { friend class DirectoryLookup; public: - HeaderSearch(FileManager &FM, DiagnosticsEngine &Diags, + HeaderSearch(llvm::IntrusiveRefCntPtr<HeaderSearchOptions> HSOpts, + FileManager &FM, DiagnosticsEngine &Diags, const LangOptions &LangOpts, const TargetInfo *Target); ~HeaderSearch(); + /// \brief Retrieve the header-search options with which this header search + /// was initialized. + HeaderSearchOptions &getHeaderSearchOpts() const { return *HSOpts; } + FileManager &getFileMgr() const { return FileMgr; } /// \brief Interface for setting the file search paths. diff --git a/include/clang/Frontend/HeaderSearchOptions.h b/include/clang/Lex/HeaderSearchOptions.h index e12884d100..468fefa4ab 100644 --- a/include/clang/Frontend/HeaderSearchOptions.h +++ b/include/clang/Lex/HeaderSearchOptions.h @@ -7,9 +7,10 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_FRONTEND_HEADERSEARCHOPTIONS_H -#define LLVM_CLANG_FRONTEND_HEADERSEARCHOPTIONS_H +#ifndef LLVM_CLANG_LEX_HEADERSEARCHOPTIONS_H +#define LLVM_CLANG_LEX_HEADERSEARCHOPTIONS_H +#include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/StringRef.h" #include <vector> @@ -36,7 +37,7 @@ namespace frontend { /// HeaderSearchOptions - Helper class for storing options related to the /// initialization of the HeaderSearch object. -class HeaderSearchOptions { +class HeaderSearchOptions : public llvm::RefCountedBase<HeaderSearchOptions> { public: struct Entry { std::string Path; |