diff options
Diffstat (limited to 'contrib/llvm-project/clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | contrib/llvm-project/clang/lib/Frontend/FrontendAction.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/contrib/llvm-project/clang/lib/Frontend/FrontendAction.cpp b/contrib/llvm-project/clang/lib/Frontend/FrontendAction.cpp index 59a968b5c709..11b25b106627 100644 --- a/contrib/llvm-project/clang/lib/Frontend/FrontendAction.cpp +++ b/contrib/llvm-project/clang/lib/Frontend/FrontendAction.cpp @@ -121,7 +121,7 @@ public: = Ctx.getDiagnostics().getCustomDiagID(DiagnosticsEngine::Error, "%0 was deserialized"); Ctx.getDiagnostics().Report(Ctx.getFullLoc(D->getLocation()), DiagID) - << ND->getNameAsString(); + << ND; } DelegatingDeserializationListener::DeclRead(ID, D); @@ -233,13 +233,12 @@ static SourceLocation ReadOriginalFileName(CompilerInstance &CI, auto &SourceMgr = CI.getSourceManager(); auto MainFileID = SourceMgr.getMainFileID(); - bool Invalid = false; - const auto *MainFileBuf = SourceMgr.getBuffer(MainFileID, &Invalid); - if (Invalid) + auto MainFileBuf = SourceMgr.getBufferOrNone(MainFileID); + if (!MainFileBuf) return SourceLocation(); std::unique_ptr<Lexer> RawLexer( - new Lexer(MainFileID, MainFileBuf, SourceMgr, CI.getLangOpts())); + new Lexer(MainFileID, *MainFileBuf, SourceMgr, CI.getLangOpts())); // If the first line has the syntax of // @@ -450,7 +449,7 @@ static bool loadModuleMapForModuleBuild(CompilerInstance &CI, bool IsSystem, PresumedModuleMapFile)) return true; - if (SrcMgr.getBuffer(ModuleMapID)->getBufferSize() == Offset) + if (SrcMgr.getBufferOrFake(ModuleMapID).getBufferSize() == Offset) Offset = 0; return false; @@ -625,7 +624,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, if (auto *File = OldSM.getFileEntryForID(ID)) Input = FrontendInputFile(File->getName(), Kind); else - Input = FrontendInputFile(OldSM.getBuffer(ID), Kind); + Input = FrontendInputFile(OldSM.getBufferOrFake(ID), Kind); } setCurrentInput(Input, std::move(AST)); } @@ -874,9 +873,9 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) { CI.createPCHExternalASTSource( CI.getPreprocessorOpts().ImplicitPCHInclude, - CI.getPreprocessorOpts().DisablePCHValidation, - CI.getPreprocessorOpts().AllowPCHWithCompilerErrors, DeserialListener, - DeleteDeserialListener); + CI.getPreprocessorOpts().DisablePCHOrModuleValidation, + CI.getPreprocessorOpts().AllowPCHWithCompilerErrors, + DeserialListener, DeleteDeserialListener); if (!CI.getASTContext().getExternalSource()) goto failure; } |