@@ -2271,8 +2271,7 @@ static void emitBlob(llvm::BitstreamWriter &Stream, StringRef Blob,
22712271// / entries for files that we actually need. In the common case (no
22722272// / errors), we probably won't have to create file entries for any of
22732273// / the files in the AST.
2274- void ASTWriter::WriteSourceManagerBlock (SourceManager &SourceMgr,
2275- const Preprocessor &PP) {
2274+ void ASTWriter::WriteSourceManagerBlock (SourceManager &SourceMgr) {
22762275 RecordData Record;
22772276
22782277 // Enter the source manager block.
@@ -2360,8 +2359,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
23602359 // We add one to the size so that we capture the trailing NULL
23612360 // that is required by llvm::MemoryBuffer::getMemBuffer (on
23622361 // the reader side).
2363- std::optional<llvm::MemoryBufferRef> Buffer =
2364- Content-> getBufferOrNone (PP .getDiagnostics (), PP .getFileManager ());
2362+ std::optional<llvm::MemoryBufferRef> Buffer = Content-> getBufferOrNone (
2363+ SourceMgr .getDiagnostics (), SourceMgr .getFileManager ());
23652364 StringRef Name = Buffer ? Buffer->getBufferIdentifier () : " " ;
23662365 Stream.EmitRecordWithBlob (SLocBufferAbbrv, Record,
23672366 StringRef (Name.data (), Name.size () + 1 ));
@@ -2371,8 +2370,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
23712370 if (EmitBlob) {
23722371 // Include the implicit terminating null character in the on-disk buffer
23732372 // if we're writing it uncompressed.
2374- std::optional<llvm::MemoryBufferRef> Buffer =
2375- Content-> getBufferOrNone (PP .getDiagnostics (), PP .getFileManager ());
2373+ std::optional<llvm::MemoryBufferRef> Buffer = Content-> getBufferOrNone (
2374+ SourceMgr .getDiagnostics (), SourceMgr .getFileManager ());
23762375 if (!Buffer)
23772376 Buffer = llvm::MemoryBufferRef (" <<<INVALID BUFFER>>>" , " " );
23782377 StringRef Blob (Buffer->getBufferStart (), Buffer->getBufferSize () + 1 );
@@ -5521,7 +5520,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
55215520 WriteDeclAndTypes (Context);
55225521
55235522 WriteFileDeclIDsMap ();
5524- WriteSourceManagerBlock (Context .getSourceManager (), PP );
5523+ WriteSourceManagerBlock (PP .getSourceManager ());
55255524 WriteComments ();
55265525 WritePreprocessor (PP, isModule);
55275526 WriteHeaderSearch (PP.getHeaderSearchInfo ());
0 commit comments