diff --git a/clang/include/clang/Lex/Preprocessor.h b/clang/include/clang/Lex/Preprocessor.h index 575d08b83fd3a..2b10ea91bde77 100644 --- a/clang/include/clang/Lex/Preprocessor.h +++ b/clang/include/clang/Lex/Preprocessor.h @@ -132,7 +132,7 @@ class Preprocessor { llvm::unique_function OnToken; std::shared_ptr PPOpts; DiagnosticsEngine *Diags; - LangOptions &LangOpts; + const LangOptions &LangOpts; const TargetInfo *Target = nullptr; const TargetInfo *AuxTarget = nullptr; FileManager &FileMgr; @@ -1161,8 +1161,9 @@ class Preprocessor { public: Preprocessor(std::shared_ptr PPOpts, - DiagnosticsEngine &diags, LangOptions &opts, SourceManager &SM, - HeaderSearch &Headers, ModuleLoader &TheModuleLoader, + DiagnosticsEngine &diags, const LangOptions &LangOpts, + SourceManager &SM, HeaderSearch &Headers, + ModuleLoader &TheModuleLoader, IdentifierInfoLookup *IILookup = nullptr, bool OwnsHeaderSearch = false, TranslationUnitKind TUKind = TU_Complete); diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index f0381c18a8b6f..6dfe7c0ccc50b 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -77,7 +77,7 @@ LLVM_INSTANTIATE_REGISTRY(PragmaHandlerRegistry) ExternalPreprocessorSource::~ExternalPreprocessorSource() = default; Preprocessor::Preprocessor(std::shared_ptr PPOpts, - DiagnosticsEngine &diags, LangOptions &opts, + DiagnosticsEngine &diags, const LangOptions &opts, SourceManager &SM, HeaderSearch &Headers, ModuleLoader &TheModuleLoader, IdentifierInfoLookup *IILookup, bool OwnsHeaders,