unsigned getSubmoduleID(Module *Mod);
/// \brief Write the given subexpression to the bitstream.
- void WriteSubStmt(Stmt *S,
- llvm::DenseMap<Stmt *, uint64_t> &SubStmtEntries,
- llvm::DenseSet<Stmt *> &ParentStmts);
+ void WriteSubStmt(Stmt *S);
void WriteBlockInfoBlock();
uint64_t WriteControlBlock(Preprocessor &PP, ASTContext &Context,
namespace clang {
class ASTStmtWriter : public StmtVisitor<ASTStmtWriter, void> {
- friend class OMPClauseWriter;
ASTWriter &Writer;
ASTRecordWriter Record;
ASTStmtWriter(const ASTStmtWriter&) = delete;
- uint64_t Emit(Stmt *S) {
+ uint64_t Emit() {
assert(Code != serialization::STMT_NULL_PTR &&
"unhandled sub-statement writing AST file");
return Record.EmitStmt(Code, AbbrevToUse);
/// \brief Write the given substatement or subexpression to the
/// bitstream.
-void ASTWriter::WriteSubStmt(Stmt *S,
- llvm::DenseMap<Stmt *, uint64_t> &SubStmtEntries,
- llvm::DenseSet<Stmt *> &ParentStmts) {
+void ASTWriter::WriteSubStmt(Stmt *S) {
RecordData Record;
ASTStmtWriter Writer(*this, Record);
++NumStatements;
Writer.Visit(S);
- SubStmtEntries[S] = Writer.Emit(S);
+ SubStmtEntries[S] = Writer.Emit();
}
/// \brief Flush all of the statements that have been added to the
assert(Writer->ParentStmts.empty() && "unexpected entries in parent stmt map");
for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
- Writer->WriteSubStmt(StmtsToEmit[I], Writer->SubStmtEntries, Writer->ParentStmts);
+ Writer->WriteSubStmt(StmtsToEmit[I]);
assert(N == StmtsToEmit.size() && "record modified while being written!");
// that a simple stack machine can be used when loading), and don't emit a
// STMT_STOP after each one.
for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
- Writer->WriteSubStmt(StmtsToEmit[N - I - 1],
- Writer->SubStmtEntries, Writer->ParentStmts);
+ Writer->WriteSubStmt(StmtsToEmit[N - I - 1]);
assert(N == StmtsToEmit.size() && "record modified while being written!");
}