[cfe-commits] r44566 - in /cfe/trunk: AST/StmtSerialization.cpp include/clang/AST/Stmt.h
Ted Kremenek
kremenek at apple.com
Mon Dec 3 16:38:31 PST 2007
Author: kremenek
Date: Mon Dec 3 18:38:30 2007
New Revision: 44566
URL: http://llvm.org/viewvc/llvm-project?rev=44566&view=rev
Log:
Implemented serialization of ObjcAtTryStmt.
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=44566&r1=44565&r2=44566&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Mon Dec 3 18:38:30 2007
@@ -162,6 +162,9 @@
case ObjcAtFinallyStmtClass:
return ObjcAtFinallyStmt::CreateImpl(D);
+ case ObjcAtTryStmtClass:
+ return ObjcAtTryStmt::CreateImpl(D);
+
case ObjCIvarRefExprClass:
return ObjCIvarRefExpr::CreateImpl(D);
}
@@ -861,12 +864,24 @@
return new ObjcAtFinallyStmt(Loc,AtFinallyStmt);
}
+void ObjcAtTryStmt::EmitImpl(Serializer& S) const {
+ S.Emit(AtTryLoc);
+ S.BatchEmitOwnedPtrs((unsigned) END_EXPR, &SubStmts[0]);
+}
+
+ObjcAtTryStmt* ObjcAtTryStmt::CreateImpl(Deserializer& D) {
+ SourceLocation L = SourceLocation::ReadVal(D);
+ ObjcAtTryStmt* stmt = new ObjcAtTryStmt(L,NULL,NULL,NULL);
+ D.BatchReadOwnedPtrs((unsigned) END_EXPR, &stmt->SubStmts[0]);
+ return stmt;
+}
+
void ObjCIvarRefExpr::EmitImpl(Serializer& S) const {
S.Emit(Loc);
S.Emit(getType());
S.EmitPtr(getDecl());
}
-
+
ObjCIvarRefExpr* ObjCIvarRefExpr::CreateImpl(Deserializer& D) {
SourceLocation Loc = SourceLocation::ReadVal(D);
QualType T = QualType::ReadVal(D);
Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=44566&r1=44565&r2=44566&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Mon Dec 3 18:38:30 2007
@@ -866,8 +866,7 @@
enum { TRY, CATCH, FINALLY, END_EXPR };
Stmt* SubStmts[END_EXPR];
- SourceLocation AtTryLoc;
-
+ SourceLocation AtTryLoc;
public:
ObjcAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt,
Stmt *atCatchStmt,
@@ -904,7 +903,9 @@
virtual child_iterator child_begin();
virtual child_iterator child_end();
-
+
+ virtual void EmitImpl(llvm::Serializer& S) const;
+ static ObjcAtTryStmt* CreateImpl(llvm::Deserializer& D);
};
/// ObjcAtThrowStmt - This represents objective-c's @throw statement.
More information about the cfe-commits
mailing list