Skip to content

Commit 304c412

Browse files
committed
[clang][serialization] Reduce ASTWriter::writeUnhashedControlBlock() scope
1 parent 4a6d13b commit 304c412

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

clang/include/clang/Serialization/ASTWriter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ class ASTWriter : public ASTDeserializationListener,
551551
void WriteControlBlock(Preprocessor &PP, StringRef isysroot);
552552

553553
/// Write out the signature and diagnostic options, and return the signature.
554-
void writeUnhashedControlBlock(Preprocessor &PP, ASTContext &Context);
554+
void writeUnhashedControlBlock(Preprocessor &PP);
555555
ASTFileSignature backpatchSignature();
556556

557557
/// Calculate hash of the pcm content.

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,8 +1269,7 @@ ASTFileSignature ASTWriter::backpatchSignature() {
12691269
return Signature;
12701270
}
12711271

1272-
void ASTWriter::writeUnhashedControlBlock(Preprocessor &PP,
1273-
ASTContext &Context) {
1272+
void ASTWriter::writeUnhashedControlBlock(Preprocessor &PP) {
12741273
using namespace llvm;
12751274

12761275
// Flush first to prepare the PCM hash (signature).
@@ -1323,7 +1322,7 @@ void ASTWriter::writeUnhashedControlBlock(Preprocessor &PP,
13231322
const auto &HSOpts = PP.getHeaderSearchInfo().getHeaderSearchOpts();
13241323

13251324
// Diagnostic options.
1326-
const auto &Diags = Context.getDiagnostics();
1325+
const auto &Diags = PP.getDiagnostics();
13271326
const DiagnosticOptions &DiagOpts = Diags.getDiagnosticOptions();
13281327
if (!HSOpts.ModulesSkipDiagnosticOptions) {
13291328
#define DIAGOPT(Name, Bits, Default) Record.push_back(DiagOpts.Name);
@@ -5368,7 +5367,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
53685367
// SourceLocations or FileIDs depends on it.
53695368
computeNonAffectingInputFiles();
53705369

5371-
writeUnhashedControlBlock(PP, Context);
5370+
writeUnhashedControlBlock(PP);
53725371

53735372
// Don't reuse type ID and Identifier ID from readers for C++ standard named
53745373
// modules since we want to support no-transitive-change model for named

0 commit comments

Comments
 (0)