From: Ted Kremenek Date: Tue, 13 Nov 2007 22:16:23 +0000 (+0000) Subject: Implemented serialization for MemberExpr. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd57e7c4754c0ce5d7d460041c8fd613e45c4319;p=clang Implemented serialization for MemberExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44074 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/AST/StmtSerialization.cpp b/AST/StmtSerialization.cpp index fb251edb43..44796c8291 100644 --- a/AST/StmtSerialization.cpp +++ b/AST/StmtSerialization.cpp @@ -110,6 +110,9 @@ Stmt* Stmt::Create(Deserializer& D) { case LabelStmtClass: return LabelStmt::CreateImpl(D); + case MemberExprClass: + return MemberExpr::CreateImpl(D); + case NullStmtClass: return NullStmt::CreateImpl(D); @@ -509,6 +512,22 @@ LabelStmt* LabelStmt::CreateImpl(Deserializer& D) { return new LabelStmt(IdentLoc,Label,SubStmt); } +void MemberExpr::EmitImpl(Serializer& S) const { + S.Emit(MemberLoc); + S.EmitPtr(MemberDecl); + S.EmitBool(IsArrow); + S.EmitOwnedPtr(Base); +} + +MemberExpr* MemberExpr::CreateImpl(Deserializer& D) { + SourceLocation L = SourceLocation::ReadVal(D); + FieldDecl* MemberDecl = cast(D.ReadPtr()); + bool IsArrow = D.ReadBool(); + Expr* base = D.ReadOwnedPtr(); + + return new MemberExpr(base,IsArrow,MemberDecl,L); +} + void NullStmt::EmitImpl(Serializer& S) const { S.Emit(SemiLoc); } diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index e69344690d..73aabd2af3 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -627,6 +627,9 @@ public: // Iterators virtual child_iterator child_begin(); virtual child_iterator child_end(); + + virtual void EmitImpl(llvm::Serializer& S) const; + static MemberExpr* CreateImpl(llvm::Deserializer& D); }; /// OCUVectorElementExpr - This represents access to specific elements of a