@@ -2234,8 +2234,7 @@ static void emitBlob(llvm::BitstreamWriter &Stream, StringRef Blob,
22342234// / entries for files that we actually need. In the common case (no
22352235// / errors), we probably won't have to create file entries for any of
22362236// / the files in the AST.
2237- void ASTWriter::WriteSourceManagerBlock (SourceManager &SourceMgr,
2238- const Preprocessor &PP) {
2237+ void ASTWriter::WriteSourceManagerBlock (SourceManager &SourceMgr) {
22392238 RecordData Record;
22402239
22412240 // Enter the source manager block.
@@ -2323,8 +2322,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
23232322 // We add one to the size so that we capture the trailing NULL
23242323 // that is required by llvm::MemoryBuffer::getMemBuffer (on
23252324 // the reader side).
2326- std::optional<llvm::MemoryBufferRef> Buffer =
2327- Content-> getBufferOrNone (PP .getDiagnostics (), PP .getFileManager ());
2325+ std::optional<llvm::MemoryBufferRef> Buffer = Content-> getBufferOrNone (
2326+ SourceMgr .getDiagnostics (), SourceMgr .getFileManager ());
23282327 StringRef Name = Buffer ? Buffer->getBufferIdentifier () : " " ;
23292328 Stream.EmitRecordWithBlob (SLocBufferAbbrv, Record,
23302329 StringRef (Name.data (), Name.size () + 1 ));
@@ -2334,8 +2333,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
23342333 if (EmitBlob) {
23352334 // Include the implicit terminating null character in the on-disk buffer
23362335 // if we're writing it uncompressed.
2337- std::optional<llvm::MemoryBufferRef> Buffer =
2338- Content-> getBufferOrNone (PP .getDiagnostics (), PP .getFileManager ());
2336+ std::optional<llvm::MemoryBufferRef> Buffer = Content-> getBufferOrNone (
2337+ SourceMgr .getDiagnostics (), SourceMgr .getFileManager ());
23392338 if (!Buffer)
23402339 Buffer = llvm::MemoryBufferRef (" <<<INVALID BUFFER>>>" , " " );
23412340 StringRef Blob (Buffer->getBufferStart (), Buffer->getBufferSize () + 1 );
@@ -5526,7 +5525,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
55265525 WriteDeclAndTypes (Context);
55275526
55285527 WriteFileDeclIDsMap ();
5529- WriteSourceManagerBlock (Context .getSourceManager (), PP );
5528+ WriteSourceManagerBlock (PP .getSourceManager ());
55305529 WriteComments ();
55315530 WritePreprocessor (PP, isModule);
55325531 WriteHeaderSearch (PP.getHeaderSearchInfo ());
0 commit comments