@@ -77,13 +77,13 @@ LLVM_INSTANTIATE_REGISTRY(PragmaHandlerRegistry)
77
77
78
78
ExternalPreprocessorSource::~ExternalPreprocessorSource() = default;
79
79
80
- Preprocessor::Preprocessor (std::shared_ptr< const PreprocessorOptions> PPOpts,
80
+ Preprocessor::Preprocessor (const PreprocessorOptions & PPOpts,
81
81
DiagnosticsEngine &diags, const LangOptions &opts,
82
82
SourceManager &SM, HeaderSearch &Headers,
83
83
ModuleLoader &TheModuleLoader,
84
84
IdentifierInfoLookup *IILookup, bool OwnsHeaders,
85
85
TranslationUnitKind TUKind)
86
- : PPOpts(std::move( PPOpts) ), Diags(&diags), LangOpts(opts),
86
+ : PPOpts(PPOpts), Diags(&diags), LangOpts(opts),
87
87
FileMgr(Headers.getFileMgr()), SourceMgr(SM),
88
88
ScratchBuf(new ScratchBuffer(SourceMgr)), HeaderInfo(Headers),
89
89
TheModuleLoader(TheModuleLoader), ExternalSource(nullptr ),
@@ -156,11 +156,11 @@ Preprocessor::Preprocessor(std::shared_ptr<const PreprocessorOptions> PPOpts,
156
156
SkippingUntilPragmaHdrStop = true ;
157
157
158
158
// 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 ())
161
161
SkippingUntilPCHThroughHeader = true ;
162
162
163
- if (this ->PPOpts -> GeneratePreamble )
163
+ if (this ->PPOpts . GeneratePreamble )
164
164
PreambleConditionalStack.startRecording ();
165
165
166
166
MaxTokens = LangOpts.MaxTokens ;
@@ -577,18 +577,18 @@ void Preprocessor::EnterMainSourceFile() {
577
577
// Start parsing the predefines.
578
578
EnterSourceFile (FID, nullptr , SourceLocation ());
579
579
580
- if (!PPOpts-> PCHThroughHeader .empty ()) {
580
+ if (!PPOpts. PCHThroughHeader .empty ()) {
581
581
// Lookup and save the FileID for the through header. If it isn't found
582
582
// in the search path, it's a fatal error.
583
583
OptionalFileEntryRef File = LookupFile (
584
- SourceLocation (), PPOpts-> PCHThroughHeader ,
584
+ SourceLocation (), PPOpts. PCHThroughHeader ,
585
585
/* isAngled=*/ false , /* FromDir=*/ nullptr , /* FromFile=*/ nullptr ,
586
586
/* CurDir=*/ nullptr , /* SearchPath=*/ nullptr , /* RelativePath=*/ nullptr ,
587
587
/* SuggestedModule=*/ nullptr , /* IsMapped=*/ nullptr ,
588
588
/* IsFrameworkFound=*/ nullptr );
589
589
if (!File) {
590
590
Diag (SourceLocation (), diag::err_pp_through_header_not_found)
591
- << PPOpts-> PCHThroughHeader ;
591
+ << PPOpts. PCHThroughHeader ;
592
592
return ;
593
593
}
594
594
setPCHThroughHeaderFileID (
@@ -614,21 +614,21 @@ bool Preprocessor::isPCHThroughHeader(const FileEntry *FE) {
614
614
}
615
615
616
616
bool Preprocessor::creatingPCHWithThroughHeader () {
617
- return TUKind == TU_Prefix && !PPOpts-> PCHThroughHeader .empty () &&
617
+ return TUKind == TU_Prefix && !PPOpts. PCHThroughHeader .empty () &&
618
618
PCHThroughHeaderFileID.isValid ();
619
619
}
620
620
621
621
bool Preprocessor::usingPCHWithThroughHeader () {
622
- return TUKind != TU_Prefix && !PPOpts-> PCHThroughHeader .empty () &&
622
+ return TUKind != TU_Prefix && !PPOpts. PCHThroughHeader .empty () &&
623
623
PCHThroughHeaderFileID.isValid ();
624
624
}
625
625
626
626
bool Preprocessor::creatingPCHWithPragmaHdrStop () {
627
- return TUKind == TU_Prefix && PPOpts-> PCHWithHdrStop ;
627
+ return TUKind == TU_Prefix && PPOpts. PCHWithHdrStop ;
628
628
}
629
629
630
630
bool Preprocessor::usingPCHWithPragmaHdrStop () {
631
- return TUKind != TU_Prefix && PPOpts-> PCHWithHdrStop ;
631
+ return TUKind != TU_Prefix && PPOpts. PCHWithHdrStop ;
632
632
}
633
633
634
634
// / Skip tokens until after the #include of the through header or
@@ -657,8 +657,8 @@ void Preprocessor::SkipTokensWhileUsingPCH() {
657
657
if (ReachedMainFileEOF) {
658
658
if (UsingPCHThroughHeader)
659
659
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 )
662
662
Diag (SourceLocation (), diag::err_pp_pragma_hdrstop_not_seen);
663
663
}
664
664
}
0 commit comments