From 519fc96c475680de2cc49e7811dbbfadb912cbcc Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 23 Oct 2019 17:52:09 +0000 Subject: Vendor import of stripped clang trunk r375505, the last commit before the upstream Subversion repository was made read-only, and the LLVM project migrated to GitHub: https://llvm.org/svn/llvm-project/cfe/trunk@375505 --- lib/Lex/Preprocessor.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib/Lex/Preprocessor.cpp') diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index bdc5fbcd2bea..82007732a9b1 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -158,6 +158,11 @@ Preprocessor::Preprocessor(std::shared_ptr PPOpts, if (this->PPOpts->GeneratePreamble) PreambleConditionalStack.startRecording(); + + ExcludedConditionalDirectiveSkipMappings = + this->PPOpts->ExcludedConditionalDirectiveSkipMappings; + if (ExcludedConditionalDirectiveSkipMappings) + ExcludedConditionalDirectiveSkipMappings->clear(); } Preprocessor::~Preprocessor() { @@ -209,7 +214,7 @@ void Preprocessor::InitializeForModelFile() { // Reset pragmas PragmaHandlersBackup = std::move(PragmaHandlers); - PragmaHandlers = llvm::make_unique(StringRef()); + PragmaHandlers = std::make_unique(StringRef()); RegisterBuiltinPragmas(); // Reset PredefinesFileID @@ -563,7 +568,7 @@ void Preprocessor::EnterMainSourceFile() { // Lookup and save the FileID for the through header. If it isn't found // in the search path, it's a fatal error. const DirectoryLookup *CurDir; - const FileEntry *File = LookupFile( + Optional File = LookupFile( SourceLocation(), PPOpts->PCHThroughHeader, /*isAngled=*/false, /*FromDir=*/nullptr, /*FromFile=*/nullptr, CurDir, /*SearchPath=*/nullptr, /*RelativePath=*/nullptr, @@ -575,7 +580,7 @@ void Preprocessor::EnterMainSourceFile() { return; } setPCHThroughHeaderFileID( - SourceMgr.createFileID(File, SourceLocation(), SrcMgr::C_User)); + SourceMgr.createFileID(*File, SourceLocation(), SrcMgr::C_User)); } // Skip tokens from the Predefines and if needed the main file. @@ -1129,7 +1134,7 @@ bool Preprocessor::LexAfterModuleImport(Token &Result) { // Allocate a holding buffer for a sequence of tokens and introduce it into // the token stream. auto EnterTokens = [this](ArrayRef Toks) { - auto ToksCopy = llvm::make_unique(Toks.size()); + auto ToksCopy = std::make_unique(Toks.size()); std::copy(Toks.begin(), Toks.end(), ToksCopy.get()); EnterTokenStream(std::move(ToksCopy), Toks.size(), /*DisableMacroExpansion*/ true, /*IsReinject*/ false); -- cgit v1.2.3