Skip to content

Commit 3ff8d55

Browse files
author
git apple-llvm automerger
committed
Merge commit 'bcb64e13172c' from llvm.org/main into next
2 parents dbba978 + bcb64e1 commit 3ff8d55

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

clang/include/clang/Serialization/ASTWriter.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,7 @@ class ASTWriter : public ASTDeserializationListener,
560560
ASTFileSignature createSignatureForNamedModule() const;
561561

562562
void WriteInputFiles(SourceManager &SourceMgr, HeaderSearchOptions &HSOpts);
563-
void WriteSourceManagerBlock(SourceManager &SourceMgr,
564-
const Preprocessor &PP);
563+
void WriteSourceManagerBlock(SourceManager &SourceMgr);
565564
void WritePreprocessor(const Preprocessor &PP, bool IsModule);
566565
void WriteHeaderSearch(const HeaderSearch &HS);
567566
void WritePreprocessorDetail(PreprocessingRecord &PPRec,

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)