@@ -77,13 +77,13 @@ LLVM_INSTANTIATE_REGISTRY(PragmaHandlerRegistry)
7777
7878ExternalPreprocessorSource::~ExternalPreprocessorSource() = default;
7979
80- Preprocessor::Preprocessor (std::shared_ptr< const PreprocessorOptions> PPOpts,
80+ Preprocessor::Preprocessor (const PreprocessorOptions & PPOpts,
8181 DiagnosticsEngine &diags, const LangOptions &opts,
8282 SourceManager &SM, HeaderSearch &Headers,
8383 ModuleLoader &TheModuleLoader,
8484 IdentifierInfoLookup *IILookup, bool OwnsHeaders,
8585 TranslationUnitKind TUKind)
86- : PPOpts(std::move( PPOpts) ), Diags(&diags), LangOpts(opts),
86+ : PPOpts(PPOpts), Diags(&diags), LangOpts(opts),
8787 FileMgr(Headers.getFileMgr()), SourceMgr(SM),
8888 ScratchBuf(new ScratchBuffer(SourceMgr)), HeaderInfo(Headers),
8989 TheModuleLoader(TheModuleLoader), ExternalSource(nullptr ),
@@ -156,11 +156,11 @@ Preprocessor::Preprocessor(std::shared_ptr<const PreprocessorOptions> PPOpts,
156156 SkippingUntilPragmaHdrStop = true ;
157157
158158 // If using a PCH with a through header, start skipping tokens.
159- if (!this ->PPOpts -> PCHThroughHeader .empty () &&
160- !this ->PPOpts -> ImplicitPCHInclude .empty ())
159+ if (!this ->PPOpts . PCHThroughHeader .empty () &&
160+ !this ->PPOpts . ImplicitPCHInclude .empty ())
161161 SkippingUntilPCHThroughHeader = true ;
162162
163- if (this ->PPOpts -> GeneratePreamble )
163+ if (this ->PPOpts . GeneratePreamble )
164164 PreambleConditionalStack.startRecording ();
165165
166166 MaxTokens = LangOpts.MaxTokens ;
@@ -577,18 +577,18 @@ void Preprocessor::EnterMainSourceFile() {
577577 // Start parsing the predefines.
578578 EnterSourceFile (FID, nullptr , SourceLocation ());
579579
580- if (!PPOpts-> PCHThroughHeader .empty ()) {
580+ if (!PPOpts. PCHThroughHeader .empty ()) {
581581 // Lookup and save the FileID for the through header. If it isn't found
582582 // in the search path, it's a fatal error.
583583 OptionalFileEntryRef File = LookupFile (
584- SourceLocation (), PPOpts-> PCHThroughHeader ,
584+ SourceLocation (), PPOpts. PCHThroughHeader ,
585585 /* isAngled=*/ false , /* FromDir=*/ nullptr , /* FromFile=*/ nullptr ,
586586 /* CurDir=*/ nullptr , /* SearchPath=*/ nullptr , /* RelativePath=*/ nullptr ,
587587 /* SuggestedModule=*/ nullptr , /* IsMapped=*/ nullptr ,
588588 /* IsFrameworkFound=*/ nullptr );
589589 if (!File) {
590590 Diag (SourceLocation (), diag::err_pp_through_header_not_found)
591- << PPOpts-> PCHThroughHeader ;
591+ << PPOpts. PCHThroughHeader ;
592592 return ;
593593 }
594594 setPCHThroughHeaderFileID (
@@ -614,21 +614,21 @@ bool Preprocessor::isPCHThroughHeader(const FileEntry *FE) {
614614}
615615
616616bool Preprocessor::creatingPCHWithThroughHeader () {
617- return TUKind == TU_Prefix && !PPOpts-> PCHThroughHeader .empty () &&
617+ return TUKind == TU_Prefix && !PPOpts. PCHThroughHeader .empty () &&
618618 PCHThroughHeaderFileID.isValid ();
619619}
620620
621621bool Preprocessor::usingPCHWithThroughHeader () {
622- return TUKind != TU_Prefix && !PPOpts-> PCHThroughHeader .empty () &&
622+ return TUKind != TU_Prefix && !PPOpts. PCHThroughHeader .empty () &&
623623 PCHThroughHeaderFileID.isValid ();
624624}
625625
626626bool Preprocessor::creatingPCHWithPragmaHdrStop () {
627- return TUKind == TU_Prefix && PPOpts-> PCHWithHdrStop ;
627+ return TUKind == TU_Prefix && PPOpts. PCHWithHdrStop ;
628628}
629629
630630bool Preprocessor::usingPCHWithPragmaHdrStop () {
631- return TUKind != TU_Prefix && PPOpts-> PCHWithHdrStop ;
631+ return TUKind != TU_Prefix && PPOpts. PCHWithHdrStop ;
632632}
633633
634634// / Skip tokens until after the #include of the through header or
@@ -657,8 +657,8 @@ void Preprocessor::SkipTokensWhileUsingPCH() {
657657 if (ReachedMainFileEOF) {
658658 if (UsingPCHThroughHeader)
659659 Diag (SourceLocation (), diag::err_pp_through_header_not_seen)
660- << PPOpts-> PCHThroughHeader << 1 ;
661- else if (!PPOpts-> PCHWithHdrStopCreate )
660+ << PPOpts. PCHThroughHeader << 1 ;
661+ else if (!PPOpts. PCHWithHdrStopCreate )
662662 Diag (SourceLocation (), diag::err_pp_pragma_hdrstop_not_seen);
663663 }
664664}
0 commit comments