@@ -564,7 +564,7 @@ class ASTWriter : public ASTDeserializationListener,
564564 void WriteHeaderSearch (const HeaderSearch &HS);
565565 void WritePreprocessorDetail (PreprocessingRecord &PPRec,
566566 uint64_t MacroOffsetsBase);
567- void WriteSubmodules (Module *WritingModule, ASTContext & Context);
567+ void WriteSubmodules (Module *WritingModule, ASTContext * Context);
568568
569569 void WritePragmaDiagnosticMappings (const DiagnosticsEngine &Diag,
570570 bool isModule);
@@ -585,7 +585,7 @@ class ASTWriter : public ASTDeserializationListener,
585585 void WriteComments (ASTContext &Context);
586586 void WriteSelectors (Sema &SemaRef);
587587 void WriteReferencedSelectorsPool (Sema &SemaRef);
588- void WriteIdentifierTable (Preprocessor &PP, IdentifierResolver & IdResolver,
588+ void WriteIdentifierTable (Preprocessor &PP, IdentifierResolver * IdResolver,
589589 bool IsModule);
590590 void WriteDeclAndTypes (ASTContext &Context);
591591 void PrepareWritingSpecialDecls (Sema &SemaRef);
@@ -642,7 +642,7 @@ class ASTWriter : public ASTDeserializationListener,
642642 void WriteDeclAbbrevs ();
643643 void WriteDecl (ASTContext &Context, Decl *D);
644644
645- ASTFileSignature WriteASTCore (Sema &SemaRef , StringRef isysroot,
645+ ASTFileSignature WriteASTCore (Sema *SemaPtr , StringRef isysroot,
646646 Module *WritingModule);
647647
648648public:
@@ -662,10 +662,13 @@ class ASTWriter : public ASTDeserializationListener,
662662 // / include timestamps in the output file.
663663 time_t getTimestampForOutput (const FileEntry *E) const ;
664664
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.
666668 // /
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.
669672 // /
670673 // / \param WritingModule The module that we are writing. If null, we are
671674 // / writing a precompiled header.
@@ -676,8 +679,9 @@ class ASTWriter : public ASTDeserializationListener,
676679 // /
677680 // / \return the module signature, which eventually will be a hash of
678681 // / 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,
681685 bool ShouldCacheASTInMemory = false );
682686
683687 // / Emit a token.
0 commit comments