From 378c151280e8ed91f647cfcdac8cd677fe639d1a Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 15 Nov 2007 18:10:29 +0000 Subject: [PATCH] Started separate section for method definitions for ObjC serialization. Added missing deserialization case in Stmt::Create() switch statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44175 91177308-0d34-0410-b5e6-96231b3b80d8 --- AST/StmtSerialization.cpp | 42 +++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/AST/StmtSerialization.cpp b/AST/StmtSerialization.cpp index d4ddf4c57f..a1fdcec0f7 100644 --- a/AST/StmtSerialization.cpp +++ b/AST/StmtSerialization.cpp @@ -151,9 +151,20 @@ Stmt* Stmt::Create(Deserializer& D) { case WhileStmtClass: return WhileStmt::CreateImpl(D); + + //==--------------------------------------==// + // Objective C + //==--------------------------------------==// + + case ObjCIvarRefExprClass: + return ObjCIvarRefExpr::CreateImpl(D); } } +//===----------------------------------------------------------------------===// +// C Serialization +//===----------------------------------------------------------------------===// + void AddrLabelExpr::EmitImpl(Serializer& S) const { S.Emit(getType()); S.Emit(AmpAmpLoc); @@ -375,19 +386,6 @@ DeclRefExpr* DeclRefExpr::CreateImpl(Deserializer& D) { return dr; } -void ObjCIvarRefExpr::EmitImpl(Serializer& S) const { - S.Emit(Loc); - S.Emit(getType()); - S.EmitPtr(getDecl()); -} - -ObjCIvarRefExpr* ObjCIvarRefExpr::CreateImpl(Deserializer& D) { - SourceLocation Loc = SourceLocation::ReadVal(D); - QualType T = QualType::ReadVal(D); - ObjCIvarRefExpr* dr = new ObjCIvarRefExpr(NULL,T,Loc); - D.ReadPtr(dr->D,false); - return dr; -} DeclStmt* DeclStmt::CreateImpl(Deserializer& D) { ScopedDecl* decl = cast(D.ReadOwnedPtr()); @@ -737,3 +735,21 @@ WhileStmt* WhileStmt::CreateImpl(Deserializer& D) { Stmt* Body = D.ReadOwnedPtr(); return new WhileStmt(Cond,Body,WhileLoc); } + +//===----------------------------------------------------------------------===// +// Objective C Serialization +//===----------------------------------------------------------------------===// + +void ObjCIvarRefExpr::EmitImpl(Serializer& S) const { + S.Emit(Loc); + S.Emit(getType()); + S.EmitPtr(getDecl()); +} + +ObjCIvarRefExpr* ObjCIvarRefExpr::CreateImpl(Deserializer& D) { + SourceLocation Loc = SourceLocation::ReadVal(D); + QualType T = QualType::ReadVal(D); + ObjCIvarRefExpr* dr = new ObjCIvarRefExpr(NULL,T,Loc); + D.ReadPtr(dr->D,false); + return dr; +} -- 2.40.0