@@ -2234,8 +2234,7 @@ static void emitBlob(llvm::BitstreamWriter &Stream, StringRef Blob,
2234
2234
// / entries for files that we actually need. In the common case (no
2235
2235
// / errors), we probably won't have to create file entries for any of
2236
2236
// / the files in the AST.
2237
- void ASTWriter::WriteSourceManagerBlock (SourceManager &SourceMgr,
2238
- const Preprocessor &PP) {
2237
+ void ASTWriter::WriteSourceManagerBlock (SourceManager &SourceMgr) {
2239
2238
RecordData Record;
2240
2239
2241
2240
// Enter the source manager block.
@@ -2323,8 +2322,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
2323
2322
// We add one to the size so that we capture the trailing NULL
2324
2323
// that is required by llvm::MemoryBuffer::getMemBuffer (on
2325
2324
// 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 ());
2328
2327
StringRef Name = Buffer ? Buffer->getBufferIdentifier () : " " ;
2329
2328
Stream.EmitRecordWithBlob (SLocBufferAbbrv, Record,
2330
2329
StringRef (Name.data (), Name.size () + 1 ));
@@ -2334,8 +2333,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
2334
2333
if (EmitBlob) {
2335
2334
// Include the implicit terminating null character in the on-disk buffer
2336
2335
// 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 ());
2339
2338
if (!Buffer)
2340
2339
Buffer = llvm::MemoryBufferRef (" <<<INVALID BUFFER>>>" , " " );
2341
2340
StringRef Blob (Buffer->getBufferStart (), Buffer->getBufferSize () + 1 );
@@ -5526,7 +5525,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
5526
5525
WriteDeclAndTypes (Context);
5527
5526
5528
5527
WriteFileDeclIDsMap ();
5529
- WriteSourceManagerBlock (Context .getSourceManager (), PP );
5528
+ WriteSourceManagerBlock (PP .getSourceManager ());
5530
5529
WriteComments ();
5531
5530
WritePreprocessor (PP, isModule);
5532
5531
WriteHeaderSearch (PP.getHeaderSearchInfo ());
0 commit comments