]> granicus.if.org Git - clang/commitdiff
Implemented serialization for MemberExpr.
authorTed Kremenek <kremenek@apple.com>
Tue, 13 Nov 2007 22:16:23 +0000 (22:16 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 13 Nov 2007 22:16:23 +0000 (22:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44074 91177308-0d34-0410-b5e6-96231b3b80d8

AST/StmtSerialization.cpp
include/clang/AST/Expr.h

index fb251edb434873ac6cdaf10f19cf97a29e116742..44796c8291ae63ad1e7f483027ae76936864d92c 100644 (file)
@@ -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<FieldDecl>(D.ReadPtr<Decl>());
+  bool IsArrow = D.ReadBool();
+  Expr* base = D.ReadOwnedPtr<Expr>();
+  
+  return new MemberExpr(base,IsArrow,MemberDecl,L); 
+}
+
 void NullStmt::EmitImpl(Serializer& S) const {
   S.Emit(SemiLoc);
 }
index e69344690ddd544c8e8e3d56623e1cc2fc94f2eb..73aabd2af3e26ce355b29978d6d9119990483a0b 100644 (file)
@@ -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