forked from OSchip/llvm-project
parent
154c790538
commit
f6d8ce1052
|
@ -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);
|
||||||
|
}
|
||||||
|
|
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue