diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/Lex/HeaderSearch.h | 6 | ||||
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Frontend/FrontendActions.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 3 |
5 files changed, 10 insertions, 7 deletions
diff --git a/clang/include/clang/Lex/HeaderSearch.h b/clang/include/clang/Lex/HeaderSearch.h index a10adae..f3dac90 100644 --- a/clang/include/clang/Lex/HeaderSearch.h +++ b/clang/include/clang/Lex/HeaderSearch.h @@ -241,7 +241,7 @@ class HeaderSearch { friend SearchDirIterator; /// Header-search options used to initialize this header search. - std::shared_ptr<HeaderSearchOptions> HSOpts; + std::shared_ptr<const HeaderSearchOptions> HSOpts; /// Mapping from SearchDir to HeaderSearchOptions::UserEntries indices. llvm::DenseMap<unsigned, unsigned> SearchDirToHSEntry; @@ -359,7 +359,7 @@ class HeaderSearch { void indexInitialHeaderMaps(); public: - HeaderSearch(std::shared_ptr<HeaderSearchOptions> HSOpts, + HeaderSearch(std::shared_ptr<const HeaderSearchOptions> HSOpts, SourceManager &SourceMgr, DiagnosticsEngine &Diags, const LangOptions &LangOpts, const TargetInfo *Target); HeaderSearch(const HeaderSearch &) = delete; @@ -367,7 +367,7 @@ public: /// Retrieve the header-search options with which this header search /// was initialized. - HeaderSearchOptions &getHeaderSearchOpts() const { return *HSOpts; } + const HeaderSearchOptions &getHeaderSearchOpts() const { return *HSOpts; } FileManager &getFileMgr() const { return FileMgr; } diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 02994bce..bff5326 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -631,7 +631,8 @@ IntrusiveRefCntPtr<ASTReader> CompilerInstance::createPCHExternalASTSource( ArrayRef<std::shared_ptr<DependencyCollector>> DependencyCollectors, void *DeserializationListener, bool OwnDeserializationListener, bool Preamble, bool UseGlobalModuleIndex) { - HeaderSearchOptions &HSOpts = PP.getHeaderSearchInfo().getHeaderSearchOpts(); + const HeaderSearchOptions &HSOpts = + PP.getHeaderSearchInfo().getHeaderSearchOpts(); IntrusiveRefCntPtr<ASTReader> Reader(new ASTReader( PP, ModCache, &Context, PCHContainerRdr, Extensions, diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp index 1ea4a2e..bf273c8 100644 --- a/clang/lib/Frontend/FrontendActions.cpp +++ b/clang/lib/Frontend/FrontendActions.cpp @@ -878,7 +878,8 @@ void DumpModuleInfoAction::ExecuteAction() { Preprocessor &PP = CI.getPreprocessor(); DumpModuleInfoListener Listener(Out); - HeaderSearchOptions &HSOpts = PP.getHeaderSearchInfo().getHeaderSearchOpts(); + const HeaderSearchOptions &HSOpts = + PP.getHeaderSearchInfo().getHeaderSearchOpts(); // The FrontendAction::BeginSourceFile () method loads the AST so that much // of the information is already available and modules should have been diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index 6fc477d..ad9263f 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -80,7 +80,7 @@ HeaderFileInfo::getControllingMacro(ExternalPreprocessorSource *External) { ExternalHeaderFileInfoSource::~ExternalHeaderFileInfoSource() = default; -HeaderSearch::HeaderSearch(std::shared_ptr<HeaderSearchOptions> HSOpts, +HeaderSearch::HeaderSearch(std::shared_ptr<const HeaderSearchOptions> HSOpts, SourceManager &SourceMgr, DiagnosticsEngine &Diags, const LangOptions &LangOpts, const TargetInfo *Target) diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 46a84bb..2728e93c 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -4901,7 +4901,8 @@ ASTReader::ASTReadResult ASTReader::ReadAST(StringRef FileName, ModuleKind Type, } } - HeaderSearchOptions &HSOpts = PP.getHeaderSearchInfo().getHeaderSearchOpts(); + const HeaderSearchOptions &HSOpts = + PP.getHeaderSearchInfo().getHeaderSearchOpts(); if (HSOpts.ModulesValidateOncePerBuildSession) { // Now we are certain that the module and all modules it depends on are // up-to-date. For implicitly-built module files, ensure the corresponding |