- Hooked up deserialization of ObjCAtSynchronizedStmt Stmt::Create().
- Some minor optimizations of the encoding format for ObjCAtSynchronizedStmt.
- Reordered methods so that the deserialization methods for
ObjCAtSynchronizedStmt appear in alphabetical order with the corresponding
methods of the other AST nodes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46529 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/StmtSerialization.cpp b/AST/StmtSerialization.cpp
index 8394dc6..8e743e6 100644
--- a/AST/StmtSerialization.cpp
+++ b/AST/StmtSerialization.cpp
@@ -161,6 +161,9 @@
case ObjCAtFinallyStmtClass:
return ObjCAtFinallyStmt::CreateImpl(D);
+
+ case ObjCAtSynchronizedStmtClass:
+ return ObjCAtSynchronizedStmt::CreateImpl(D);
case ObjCAtThrowStmtClass:
return ObjCAtThrowStmt::CreateImpl(D);
@@ -883,6 +886,20 @@
return new ObjCAtFinallyStmt(Loc,AtFinallyStmt);
}
+void ObjCAtSynchronizedStmt::EmitImpl(Serializer& S) const {
+ S.Emit(AtSynchronizedLoc);
+ S.BatchEmitOwnedPtrs(SynchExpr, SynchBody);
+}
+
+ObjCAtSynchronizedStmt* ObjCAtSynchronizedStmt::CreateImpl(Deserializer& D) {
+ SourceLocation L = SourceLocation::ReadVal(D);
+ Expr *syncExpr;
+ Stmt *synchBody;
+ D.BatchReadOwnedPtrs(syncExpr, synchBody);
+ ObjCAtSynchronizedStmt* stmt = new ObjCAtSynchronizedStmt(L,syncExpr,synchBody);
+ return stmt;
+}
+
void ObjCAtThrowStmt::EmitImpl(Serializer& S) const {
S.Emit(AtThrowLoc);
S.EmitOwnedPtr(Throw);
@@ -893,20 +910,6 @@
Stmt* Throw = D.ReadOwnedPtr<Stmt>();
return new ObjCAtThrowStmt(L,Throw);
}
-
-void ObjCAtSynchronizedStmt::EmitImpl(Serializer& S) const {
- S.Emit(AtSynchronizedLoc);
- S.EmitOwnedPtr(SynchExpr);
- S.EmitOwnedPtr(SynchBody);
-}
-
-ObjCAtSynchronizedStmt* ObjCAtSynchronizedStmt::CreateImpl(Deserializer& D) {
- SourceLocation L = SourceLocation::ReadVal(D);
- Expr *syncExpr = D.ReadOwnedPtr<Expr>();
- Stmt *synchBody = D.ReadOwnedPtr<Stmt>();
- ObjCAtSynchronizedStmt* stmt = new ObjCAtSynchronizedStmt(L,syncExpr,synchBody);
- return stmt;
-}
void ObjCAtTryStmt::EmitImpl(Serializer& S) const {
S.Emit(AtTryLoc);