diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2008-01-02 22:54:34 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-01-02 22:54:34 +0000 |
| commit | 0196cab54007ff072ec2642da8911c6b7e8d3fb5 (patch) | |
| tree | 4a0181db2ba74855d3cdd17cadec69a5cc12d5ef /AST/StmtSerialization.cpp | |
| parent | 529bd02affa96a311dd9ab131f2ab4d833017fb7 (diff) | |
New declarations/defs for Objc2's foreach-statement. This is work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45511 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'AST/StmtSerialization.cpp')
| -rw-r--r-- | AST/StmtSerialization.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/AST/StmtSerialization.cpp b/AST/StmtSerialization.cpp index d6f9dca49a..53dabbd018 100644 --- a/AST/StmtSerialization.cpp +++ b/AST/StmtSerialization.cpp @@ -94,6 +94,9 @@ Stmt* Stmt::Create(Deserializer& D) { case ForStmtClass: return ForStmt::CreateImpl(D); + + case ObjcForCollectionStmtClass: + return ObjcForCollectionStmt::CreateImpl(D); case GotoStmtClass: return GotoStmt::CreateImpl(D); @@ -560,6 +563,21 @@ ForStmt* ForStmt::CreateImpl(Deserializer& D) { return new ForStmt(Init,Cond,Inc,Body,ForLoc); } +void ObjcForCollectionStmt::EmitImpl(Serializer& S) const { + S.Emit(ForCollectionLoc); + S.EmitOwnedPtr(getElement()); + S.EmitOwnedPtr(getCollection()); + S.EmitOwnedPtr(getBody()); +} + +ObjcForCollectionStmt* ObjcForCollectionStmt::CreateImpl(Deserializer& D) { + SourceLocation ForCollectionLoc = SourceLocation::ReadVal(D); + Stmt* Element = D.ReadOwnedPtr<Stmt>(); + Expr* Collection = D.ReadOwnedPtr<Expr>(); + Stmt* Body = D.ReadOwnedPtr<Stmt>(); + return new ObjcForCollectionStmt(Element,Collection,Body,ForCollectionLoc); +} + void GotoStmt::EmitImpl(Serializer& S) const { S.Emit(GotoLoc); S.Emit(LabelLoc); |
