@@ -564,7 +564,7 @@ class ASTWriter : public ASTDeserializationListener,
564
564
void WriteHeaderSearch (const HeaderSearch &HS);
565
565
void WritePreprocessorDetail (PreprocessingRecord &PPRec,
566
566
uint64_t MacroOffsetsBase);
567
- void WriteSubmodules (Module *WritingModule, ASTContext & Context);
567
+ void WriteSubmodules (Module *WritingModule, ASTContext * Context);
568
568
569
569
void WritePragmaDiagnosticMappings (const DiagnosticsEngine &Diag,
570
570
bool isModule);
@@ -585,7 +585,7 @@ class ASTWriter : public ASTDeserializationListener,
585
585
void WriteComments (ASTContext &Context);
586
586
void WriteSelectors (Sema &SemaRef);
587
587
void WriteReferencedSelectorsPool (Sema &SemaRef);
588
- void WriteIdentifierTable (Preprocessor &PP, IdentifierResolver & IdResolver,
588
+ void WriteIdentifierTable (Preprocessor &PP, IdentifierResolver * IdResolver,
589
589
bool IsModule);
590
590
void WriteDeclAndTypes (ASTContext &Context);
591
591
void PrepareWritingSpecialDecls (Sema &SemaRef);
@@ -642,7 +642,7 @@ class ASTWriter : public ASTDeserializationListener,
642
642
void WriteDeclAbbrevs ();
643
643
void WriteDecl (ASTContext &Context, Decl *D);
644
644
645
- ASTFileSignature WriteASTCore (Sema &SemaRef , StringRef isysroot,
645
+ ASTFileSignature WriteASTCore (Sema *SemaPtr , StringRef isysroot,
646
646
Module *WritingModule);
647
647
648
648
public:
@@ -662,10 +662,13 @@ class ASTWriter : public ASTDeserializationListener,
662
662
// / include timestamps in the output file.
663
663
time_t getTimestampForOutput (const FileEntry *E) const ;
664
664
665
- // / Write a precompiled header for the given semantic analysis.
665
+ // / Write a precompiled header or a module with the AST produced by the
666
+ // / \c Sema object, or a dependency scanner module with the preprocessor state
667
+ // / produced by the \c Preprocessor object.
666
668
// /
667
- // / \param SemaRef a reference to the semantic analysis object that processed
668
- // / the AST to be written into the precompiled header.
669
+ // / \param Subject The \c Sema object that processed the AST to be written, or
670
+ // / in the case of a dependency scanner module the \c Preprocessor that holds
671
+ // / the state.
669
672
// /
670
673
// / \param WritingModule The module that we are writing. If null, we are
671
674
// / writing a precompiled header.
@@ -676,8 +679,9 @@ class ASTWriter : public ASTDeserializationListener,
676
679
// /
677
680
// / \return the module signature, which eventually will be a hash of
678
681
// / the module but currently is merely a random 32-bit number.
679
- ASTFileSignature WriteAST (Sema &SemaRef, StringRef OutputFile,
680
- Module *WritingModule, StringRef isysroot,
682
+ ASTFileSignature WriteAST (llvm::PointerUnion<Sema *, Preprocessor *> Subject,
683
+ StringRef OutputFile, Module *WritingModule,
684
+ StringRef isysroot,
681
685
bool ShouldCacheASTInMemory = false );
682
686
683
687
// / Emit a token.
0 commit comments