diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-11-07 07:50:10 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-11-07 07:50:10 +0000 |
commit | 5572b94b76a78a35bac32d1ef04907c7a651adba (patch) | |
tree | 8b86fc5a0a88ab3693daa56a83d1bf7ca57e0f74 | |
parent | 4210f3dfd73ad3482f9cfa0a382e1fd78f22976d (diff) |
Implemented serialization for WhileStmt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43815 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | AST/StmtSerialization.cpp | 16 | ||||
-rw-r--r-- | include/clang/AST/Stmt.h | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/AST/StmtSerialization.cpp b/AST/StmtSerialization.cpp index c6af9a50c7..bd8b5ca5e1 100644 --- a/AST/StmtSerialization.cpp +++ b/AST/StmtSerialization.cpp @@ -72,6 +72,9 @@ Stmt* Stmt::Materialize(llvm::Deserializer& D) { case SwitchStmtClass: return SwitchStmt::directMaterialize(D); + + case WhileStmtClass: + return WhileStmt::directMaterialize(D); } } @@ -284,3 +287,16 @@ SwitchStmt* SwitchStmt::directMaterialize(llvm::Deserializer& D) { 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); +} diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index 523eda69a0..c04a544a69 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -485,6 +485,9 @@ public: // Iterators virtual child_iterator child_begin(); 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. |