@@ -2264,8 +2264,7 @@ static void emitBlob(llvm::BitstreamWriter &Stream, StringRef Blob,
22642264// / entries for files that we actually need. In the common case (no
22652265// / errors), we probably won't have to create file entries for any of
22662266// / the files in the AST.
2267- void ASTWriter::WriteSourceManagerBlock (SourceManager &SourceMgr,
2268- const Preprocessor &PP) {
2267+ void ASTWriter::WriteSourceManagerBlock (SourceManager &SourceMgr) {
22692268 RecordData Record;
22702269
22712270 // Enter the source manager block.
@@ -2353,8 +2352,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
23532352 // We add one to the size so that we capture the trailing NULL
23542353 // that is required by llvm::MemoryBuffer::getMemBuffer (on
23552354 // the reader side).
2356- std::optional<llvm::MemoryBufferRef> Buffer =
2357- Content-> getBufferOrNone (PP .getDiagnostics (), PP .getFileManager ());
2355+ std::optional<llvm::MemoryBufferRef> Buffer = Content-> getBufferOrNone (
2356+ SourceMgr .getDiagnostics (), SourceMgr .getFileManager ());
23582357 StringRef Name = Buffer ? Buffer->getBufferIdentifier () : " " ;
23592358 Stream.EmitRecordWithBlob (SLocBufferAbbrv, Record,
23602359 StringRef (Name.data (), Name.size () + 1 ));
@@ -2364,8 +2363,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
23642363 if (EmitBlob) {
23652364 // Include the implicit terminating null character in the on-disk buffer
23662365 // if we're writing it uncompressed.
2367- std::optional<llvm::MemoryBufferRef> Buffer =
2368- Content-> getBufferOrNone (PP .getDiagnostics (), PP .getFileManager ());
2366+ std::optional<llvm::MemoryBufferRef> Buffer = Content-> getBufferOrNone (
2367+ SourceMgr .getDiagnostics (), SourceMgr .getFileManager ());
23692368 if (!Buffer)
23702369 Buffer = llvm::MemoryBufferRef (" <<<INVALID BUFFER>>>" , " " );
23712370 StringRef Blob (Buffer->getBufferStart (), Buffer->getBufferSize () + 1 );
@@ -5512,7 +5511,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
55125511 WriteDeclAndTypes (Context);
55135512
55145513 WriteFileDeclIDsMap ();
5515- WriteSourceManagerBlock (Context .getSourceManager (), PP );
5514+ WriteSourceManagerBlock (PP .getSourceManager ());
55165515 WriteComments ();
55175516 WritePreprocessor (PP, isModule);
55185517 WriteHeaderSearch (PP.getHeaderSearchInfo ());
0 commit comments