Implemented serialization for WhileStmt.

llvm-svn: 43815
This commit is contained in:
Ted Kremenek 2007-11-07 07:50:10 +00:00
parent 154c790538
commit f6d8ce1052
2 changed files with 19 additions and 0 deletions

View File

@ -72,6 +72,9 @@ Stmt* Stmt::Materialize(llvm::Deserializer& D) {
case SwitchStmtClass: case SwitchStmtClass:
return SwitchStmt::directMaterialize(D); return SwitchStmt::directMaterialize(D);
case WhileStmtClass:
return WhileStmt::directMaterialize(D);
} }
} }
@ -284,3 +287,16 @@ SwitchStmt* SwitchStmt::directMaterialize(llvm::Deserializer& D) {
return stmt; return stmt;
} }
void WhileStmt::directEmit(llvm::Serializer& S) const {
S.Emit(WhileLoc);
S.EmitOwnedPtr(getCond());
S.EmitOwnedPtr(getBody());
}
WhileStmt* WhileStmt::directMaterialize(llvm::Deserializer& D) {
SourceLocation WhileLoc = SourceLocation::ReadVal(D);
Expr* Cond = D.ReadOwnedPtr<Expr>();
Stmt* Body = D.ReadOwnedPtr<Stmt>();
return new WhileStmt(Cond,Body,WhileLoc);
}

View File

@ -485,6 +485,9 @@ public:
// Iterators // Iterators
virtual child_iterator child_begin(); virtual child_iterator child_begin();
virtual child_iterator child_end(); virtual child_iterator child_end();
virtual void directEmit(llvm::Serializer& S) const;
static WhileStmt* directMaterialize(llvm::Deserializer& D);
}; };
/// DoStmt - This represents a 'do/while' stmt. /// DoStmt - This represents a 'do/while' stmt.