Implemented serialization for ForStmt.

llvm-svn: 43817
This commit is contained in:
Ted Kremenek 2007-11-07 08:02:55 +00:00
parent 83e96b8d5a
commit 35e20410aa
2 changed files with 23 additions and 0 deletions

View File

@ -54,6 +54,9 @@ Stmt* Stmt::Materialize(llvm::Deserializer& D) {
case DoStmtClass:
return DoStmt::directMaterialize(D);
case ForStmtClass:
return ForStmt::directMaterialize(D);
case IfStmtClass:
return IfStmt::directMaterialize(D);
@ -204,6 +207,23 @@ DoStmt* DoStmt::directMaterialize(llvm::Deserializer& D) {
return new DoStmt(Body,Cond,DoLoc);
}
void ForStmt::directEmit(llvm::Serializer& S) const {
S.Emit(ForLoc);
S.EmitOwnedPtr(getInit());
S.EmitOwnedPtr(getCond());
S.EmitOwnedPtr(getInc());
S.EmitOwnedPtr(getBody());
}
ForStmt* ForStmt::directMaterialize(llvm::Deserializer& D) {
SourceLocation ForLoc = SourceLocation::ReadVal(D);
Stmt* Init = D.ReadOwnedPtr<Stmt>();
Expr* Cond = D.ReadOwnedPtr<Expr>();
Expr* Inc = D.ReadOwnedPtr<Expr>();
Stmt* Body = D.ReadOwnedPtr<Stmt>();
return new ForStmt(Init,Cond,Inc,Body,ForLoc);
}
void IfStmt::directEmit(llvm::Serializer& S) const {
S.Emit(IfLoc);
S.EmitOwnedPtr(getCond());

View File

@ -565,6 +565,9 @@ public:
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
virtual void directEmit(llvm::Serializer& S) const;
static ForStmt* directMaterialize(llvm::Deserializer& D);
};
/// GotoStmt - This represents a direct goto.