[cfe-commits] r44075 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Expr.h

Ted Kremenek kremenek at apple.com
Tue Nov 13 14:30:30 PST 2007


Author: kremenek
Date: Tue Nov 13 16:30:29 2007
New Revision: 44075

URL: http://llvm.org/viewvc/llvm-project?rev=44075&view=rev
Log:
Implemented serialization for SizeOfAlignOfTypeExpr.

Modified:
    cfe/trunk/AST/StmtSerialization.cpp
    cfe/trunk/include/clang/AST/Expr.h

Modified: cfe/trunk/AST/StmtSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtSerialization.cpp?rev=44075&r1=44074&r2=44075&view=diff

==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Tue Nov 13 16:30:29 2007
@@ -125,6 +125,9 @@
     case ReturnStmtClass:
       return ReturnStmt::CreateImpl(D);
     
+    case SizeOfAlignOfTypeExprClass:
+      return SizeOfAlignOfTypeExpr::CreateImpl(D);
+      
     case StmtExprClass:
       return StmtExpr::CreateImpl(D);
       
@@ -574,6 +577,24 @@
   return new ReturnStmt(RetLoc,RetExpr);
 }
 
+void SizeOfAlignOfTypeExpr::EmitImpl(Serializer& S) const {
+  S.EmitBool(isSizeof);
+  S.Emit(Ty);
+  S.Emit(getType());
+  S.Emit(OpLoc);
+  S.Emit(RParenLoc);
+}
+
+SizeOfAlignOfTypeExpr* SizeOfAlignOfTypeExpr::CreateImpl(Deserializer& D) {
+  bool isSizeof = D.ReadBool();
+  QualType Ty = QualType::ReadVal(D);
+  QualType Res = QualType::ReadVal(D);
+  SourceLocation OpLoc = SourceLocation::ReadVal(D);
+  SourceLocation RParenLoc = SourceLocation::ReadVal(D);
+  
+  return new SizeOfAlignOfTypeExpr(isSizeof,Ty,Res,OpLoc,RParenLoc);  
+}
+
 void StmtExpr::EmitImpl(Serializer& S) const {
   S.Emit(getType());
   S.Emit(LParenLoc);

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=44075&r1=44074&r2=44075&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Tue Nov 13 16:30:29 2007
@@ -466,6 +466,9 @@
   // Iterators
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
+  
+  virtual void EmitImpl(llvm::Serializer& S) const;
+  static SizeOfAlignOfTypeExpr* CreateImpl(llvm::Deserializer& D);
 };
 
 //===----------------------------------------------------------------------===//





More information about the cfe-commits mailing list