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

Ted Kremenek kremenek at apple.com
Mon Dec 3 16:40:49 PST 2007


Author: kremenek
Date: Mon Dec  3 18:40:49 2007
New Revision: 44567

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

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

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

==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Mon Dec  3 18:40:49 2007
@@ -162,6 +162,9 @@
     case ObjcAtFinallyStmtClass:
       return ObjcAtFinallyStmt::CreateImpl(D);
       
+    case ObjcAtThrowStmtClass:
+      return ObjcAtThrowStmt::CreateImpl(D);
+      
     case ObjcAtTryStmtClass:
       return ObjcAtTryStmt::CreateImpl(D);
       
@@ -864,6 +867,17 @@
   return new ObjcAtFinallyStmt(Loc,AtFinallyStmt);  
 }
 
+void ObjcAtThrowStmt::EmitImpl(Serializer& S) const {
+  S.Emit(AtThrowLoc);
+  S.EmitOwnedPtr(Throw);
+}
+
+ObjcAtThrowStmt* ObjcAtThrowStmt::CreateImpl(Deserializer& D) {
+  SourceLocation L = SourceLocation::ReadVal(D);
+  Stmt* Throw = D.ReadOwnedPtr<Stmt>();
+  return new ObjcAtThrowStmt(L,Throw);  
+}
+  
 void ObjcAtTryStmt::EmitImpl(Serializer& S) const {
   S.Emit(AtTryLoc);
   S.BatchEmitOwnedPtrs((unsigned) END_EXPR, &SubStmts[0]);

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

==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Mon Dec  3 18:40:49 2007
@@ -910,10 +910,8 @@
 
 /// ObjcAtThrowStmt - This represents objective-c's @throw statement.
 class ObjcAtThrowStmt : public Stmt {
-private:
   Stmt *Throw;
   SourceLocation AtThrowLoc;
-
 public:
   ObjcAtThrowStmt(SourceLocation atThrowLoc, Stmt *throwExpr)
   : Stmt(ObjcAtThrowStmtClass), Throw(throwExpr) {
@@ -933,6 +931,9 @@
   
   virtual child_iterator child_begin();
   virtual child_iterator child_end();
+  
+  virtual void EmitImpl(llvm::Serializer& S) const;
+  static ObjcAtThrowStmt* CreateImpl(llvm::Deserializer& D); 
 };
 
 }  // end namespace clang





More information about the cfe-commits mailing list