Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions clang/include/clang/Serialization/ASTWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ class ASTWriter : public ASTDeserializationListener,
void WriteHeaderSearch(const HeaderSearch &HS);
void WritePreprocessorDetail(PreprocessingRecord &PPRec,
uint64_t MacroOffsetsBase);
void WriteSubmodules(Module *WritingModule, ASTContext &Context);
void WriteSubmodules(Module *WritingModule, ASTContext *Context);

void WritePragmaDiagnosticMappings(const DiagnosticsEngine &Diag,
bool isModule);
Expand All @@ -582,7 +582,7 @@ class ASTWriter : public ASTDeserializationListener,
void WriteComments(ASTContext &Context);
void WriteSelectors(Sema &SemaRef);
void WriteReferencedSelectorsPool(Sema &SemaRef);
void WriteIdentifierTable(Preprocessor &PP, IdentifierResolver &IdResolver,
void WriteIdentifierTable(Preprocessor &PP, IdentifierResolver *IdResolver,
bool IsModule);
void WriteDeclAndTypes(ASTContext &Context);
void PrepareWritingSpecialDecls(Sema &SemaRef);
Expand Down Expand Up @@ -639,7 +639,7 @@ class ASTWriter : public ASTDeserializationListener,
void WriteDeclAbbrevs();
void WriteDecl(ASTContext &Context, Decl *D);

ASTFileSignature WriteASTCore(Sema &SemaRef, StringRef isysroot,
ASTFileSignature WriteASTCore(Sema *SemaPtr, StringRef isysroot,
Module *WritingModule);

public:
Expand All @@ -661,8 +661,8 @@ class ASTWriter : public ASTDeserializationListener,

/// Write a precompiled header for the given semantic analysis.
///
/// \param SemaRef a reference to the semantic analysis object that processed
/// the AST to be written into the precompiled header.
/// \param Subject The object that processed the input to be written into the
/// AST file.
///
/// \param WritingModule The module that we are writing. If null, we are
/// writing a precompiled header.
Expand All @@ -673,8 +673,9 @@ class ASTWriter : public ASTDeserializationListener,
///
/// \return the module signature, which eventually will be a hash of
/// the module but currently is merely a random 32-bit number.
ASTFileSignature WriteAST(Sema &SemaRef, StringRef OutputFile,
Module *WritingModule, StringRef isysroot,
ASTFileSignature WriteAST(llvm::PointerUnion<Sema *, Preprocessor *> Subject,
StringRef OutputFile, Module *WritingModule,
StringRef isysroot,
bool ShouldCacheASTInMemory = false);

/// Emit a token.
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Frontend/ASTUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2359,7 +2359,7 @@ bool ASTUnit::Save(StringRef File) {

static bool serializeUnit(ASTWriter &Writer, SmallVectorImpl<char> &Buffer,
Sema &S, raw_ostream &OS) {
Writer.WriteAST(S, std::string(), nullptr, "");
Writer.WriteAST(&S, std::string(), nullptr, "");

// Write the generated bitstream to "Out".
if (!Buffer.empty())
Expand Down
Loading
Loading