@@ -2264,8 +2264,7 @@ static void emitBlob(llvm::BitstreamWriter &Stream, StringRef Blob,
2264
2264
// / entries for files that we actually need. In the common case (no
2265
2265
// / errors), we probably won't have to create file entries for any of
2266
2266
// / the files in the AST.
2267
- void ASTWriter::WriteSourceManagerBlock (SourceManager &SourceMgr,
2268
- const Preprocessor &PP) {
2267
+ void ASTWriter::WriteSourceManagerBlock (SourceManager &SourceMgr) {
2269
2268
RecordData Record;
2270
2269
2271
2270
// Enter the source manager block.
@@ -2353,8 +2352,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
2353
2352
// We add one to the size so that we capture the trailing NULL
2354
2353
// that is required by llvm::MemoryBuffer::getMemBuffer (on
2355
2354
// 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 ());
2358
2357
StringRef Name = Buffer ? Buffer->getBufferIdentifier () : " " ;
2359
2358
Stream.EmitRecordWithBlob (SLocBufferAbbrv, Record,
2360
2359
StringRef (Name.data (), Name.size () + 1 ));
@@ -2364,8 +2363,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
2364
2363
if (EmitBlob) {
2365
2364
// Include the implicit terminating null character in the on-disk buffer
2366
2365
// 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 ());
2369
2368
if (!Buffer)
2370
2369
Buffer = llvm::MemoryBufferRef (" <<<INVALID BUFFER>>>" , " " );
2371
2370
StringRef Blob (Buffer->getBufferStart (), Buffer->getBufferSize () + 1 );
@@ -5512,7 +5511,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
5512
5511
WriteDeclAndTypes (Context);
5513
5512
5514
5513
WriteFileDeclIDsMap ();
5515
- WriteSourceManagerBlock (Context .getSourceManager (), PP );
5514
+ WriteSourceManagerBlock (PP .getSourceManager ());
5516
5515
WriteComments ();
5517
5516
WritePreprocessor (PP, isModule);
5518
5517
WriteHeaderSearch (PP.getHeaderSearchInfo ());
0 commit comments