From 5bdd4e300b432246b9d261702828e9875414128b Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 4 Dec 2007 00:40:49 +0000 Subject: [PATCH] Implemented serialization for ObjcAtThrowStmt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44567 91177308-0d34-0410-b5e6-96231b3b80d8 --- AST/StmtSerialization.cpp | 14 ++++++++++++++ include/clang/AST/Stmt.h | 5 +++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/AST/StmtSerialization.cpp b/AST/StmtSerialization.cpp index ab639d9ade..55ea3e4eae 100644 --- a/AST/StmtSerialization.cpp +++ b/AST/StmtSerialization.cpp @@ -162,6 +162,9 @@ Stmt* Stmt::Create(Deserializer& D) { case ObjcAtFinallyStmtClass: return ObjcAtFinallyStmt::CreateImpl(D); + case ObjcAtThrowStmtClass: + return ObjcAtThrowStmt::CreateImpl(D); + case ObjcAtTryStmtClass: return ObjcAtTryStmt::CreateImpl(D); @@ -864,6 +867,17 @@ ObjcAtFinallyStmt* ObjcAtFinallyStmt::CreateImpl(Deserializer& D) { 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(); + return new ObjcAtThrowStmt(L,Throw); +} + void ObjcAtTryStmt::EmitImpl(Serializer& S) const { S.Emit(AtTryLoc); S.BatchEmitOwnedPtrs((unsigned) END_EXPR, &SubStmts[0]); diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index fa877ccf94..6d7b93a425 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -910,10 +910,8 @@ public: /// 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 @@ public: 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 -- 2.40.0