Skip to content

Commit fa89d91

Browse files
committed
[clang][serialization] Reduce ASTWriter::writeUnhashedControlBlock() scope
(cherry picked from commit 304c412)
1 parent 44fb953 commit fa89d91

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
@@ -543,7 +543,7 @@ class ASTWriter : public ASTDeserializationListener,
543543
void WriteControlBlock(Preprocessor &PP, StringRef isysroot);
544544

545545
/// Write out the signature and diagnostic options, and return the signature.
546-
void writeUnhashedControlBlock(Preprocessor &PP, ASTContext &Context);
546+
void writeUnhashedControlBlock(Preprocessor &PP);
547547
ASTFileSignature backpatchSignature();
548548

549549
/// 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
@@ -1264,8 +1264,7 @@ ASTFileSignature ASTWriter::backpatchSignature() {
12641264
return Signature;
12651265
}
12661266

1267-
void ASTWriter::writeUnhashedControlBlock(Preprocessor &PP,
1268-
ASTContext &Context) {
1267+
void ASTWriter::writeUnhashedControlBlock(Preprocessor &PP) {
12691268
using namespace llvm;
12701269

12711270
// Flush first to prepare the PCM hash (signature).
@@ -1318,7 +1317,7 @@ void ASTWriter::writeUnhashedControlBlock(Preprocessor &PP,
13181317
const auto &HSOpts = PP.getHeaderSearchInfo().getHeaderSearchOpts();
13191318

13201319
// Diagnostic options.
1321-
const auto &Diags = Context.getDiagnostics();
1320+
const auto &Diags = PP.getDiagnostics();
13221321
const DiagnosticOptions &DiagOpts = Diags.getDiagnosticOptions();
13231322
if (!HSOpts.ModulesSkipDiagnosticOptions) {
13241323
#define DIAGOPT(Name, Bits, Default) Record.push_back(DiagOpts.Name);
@@ -5355,7 +5354,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
53555354
// SourceLocations or FileIDs depends on it.
53565355
computeNonAffectingInputFiles();
53575356

5358-
writeUnhashedControlBlock(PP, Context);
5357+
writeUnhashedControlBlock(PP);
53595358

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

0 commit comments

Comments
 (0)