aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index ff99575..c25a3ef 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -77,13 +77,13 @@ LLVM_INSTANTIATE_REGISTRY(PragmaHandlerRegistry)
ExternalPreprocessorSource::~ExternalPreprocessorSource() = default;
-Preprocessor::Preprocessor(std::shared_ptr<const PreprocessorOptions> PPOpts,
+Preprocessor::Preprocessor(const PreprocessorOptions &PPOpts,
DiagnosticsEngine &diags, const LangOptions &opts,
SourceManager &SM, HeaderSearch &Headers,
ModuleLoader &TheModuleLoader,
IdentifierInfoLookup *IILookup, bool OwnsHeaders,
TranslationUnitKind TUKind)
- : PPOpts(std::move(PPOpts)), Diags(&diags), LangOpts(opts),
+ : PPOpts(PPOpts), Diags(&diags), LangOpts(opts),
FileMgr(Headers.getFileMgr()), SourceMgr(SM),
ScratchBuf(new ScratchBuffer(SourceMgr)), HeaderInfo(Headers),
TheModuleLoader(TheModuleLoader), ExternalSource(nullptr),
@@ -156,11 +156,11 @@ Preprocessor::Preprocessor(std::shared_ptr<const PreprocessorOptions> PPOpts,
SkippingUntilPragmaHdrStop = true;
// If using a PCH with a through header, start skipping tokens.
- if (!this->PPOpts->PCHThroughHeader.empty() &&
- !this->PPOpts->ImplicitPCHInclude.empty())
+ if (!this->PPOpts.PCHThroughHeader.empty() &&
+ !this->PPOpts.ImplicitPCHInclude.empty())
SkippingUntilPCHThroughHeader = true;
- if (this->PPOpts->GeneratePreamble)
+ if (this->PPOpts.GeneratePreamble)
PreambleConditionalStack.startRecording();
MaxTokens = LangOpts.MaxTokens;
@@ -577,18 +577,18 @@ void Preprocessor::EnterMainSourceFile() {
// Start parsing the predefines.
EnterSourceFile(FID, nullptr, SourceLocation());
- if (!PPOpts->PCHThroughHeader.empty()) {
+ if (!PPOpts.PCHThroughHeader.empty()) {
// Lookup and save the FileID for the through header. If it isn't found
// in the search path, it's a fatal error.
OptionalFileEntryRef File = LookupFile(
- SourceLocation(), PPOpts->PCHThroughHeader,
+ SourceLocation(), PPOpts.PCHThroughHeader,
/*isAngled=*/false, /*FromDir=*/nullptr, /*FromFile=*/nullptr,
/*CurDir=*/nullptr, /*SearchPath=*/nullptr, /*RelativePath=*/nullptr,
/*SuggestedModule=*/nullptr, /*IsMapped=*/nullptr,
/*IsFrameworkFound=*/nullptr);
if (!File) {
Diag(SourceLocation(), diag::err_pp_through_header_not_found)
- << PPOpts->PCHThroughHeader;
+ << PPOpts.PCHThroughHeader;
return;
}
setPCHThroughHeaderFileID(
@@ -614,21 +614,21 @@ bool Preprocessor::isPCHThroughHeader(const FileEntry *FE) {
}
bool Preprocessor::creatingPCHWithThroughHeader() {
- return TUKind == TU_Prefix && !PPOpts->PCHThroughHeader.empty() &&
+ return TUKind == TU_Prefix && !PPOpts.PCHThroughHeader.empty() &&
PCHThroughHeaderFileID.isValid();
}
bool Preprocessor::usingPCHWithThroughHeader() {
- return TUKind != TU_Prefix && !PPOpts->PCHThroughHeader.empty() &&
+ return TUKind != TU_Prefix && !PPOpts.PCHThroughHeader.empty() &&
PCHThroughHeaderFileID.isValid();
}
bool Preprocessor::creatingPCHWithPragmaHdrStop() {
- return TUKind == TU_Prefix && PPOpts->PCHWithHdrStop;
+ return TUKind == TU_Prefix && PPOpts.PCHWithHdrStop;
}
bool Preprocessor::usingPCHWithPragmaHdrStop() {
- return TUKind != TU_Prefix && PPOpts->PCHWithHdrStop;
+ return TUKind != TU_Prefix && PPOpts.PCHWithHdrStop;
}
/// Skip tokens until after the #include of the through header or
@@ -657,8 +657,8 @@ void Preprocessor::SkipTokensWhileUsingPCH() {
if (ReachedMainFileEOF) {
if (UsingPCHThroughHeader)
Diag(SourceLocation(), diag::err_pp_through_header_not_seen)
- << PPOpts->PCHThroughHeader << 1;
- else if (!PPOpts->PCHWithHdrStopCreate)
+ << PPOpts.PCHThroughHeader << 1;
+ else if (!PPOpts.PCHWithHdrStopCreate)
Diag(SourceLocation(), diag::err_pp_pragma_hdrstop_not_seen);
}
}