For ObjCAtCatchStmt, removed field 'NextAtCatchStmt' (which referenced the next @catch)
and put the the next ObjcAtCatchStmt* as part of SubExprs. This fixes a bug with
iterating over the children of ObjcAtCatch, where the next @catch was not
properly being iterated over as a child.
Altered serialization of ObjCAtCatchStmt to reflect this new layout of
its subexpressions, and fixed an ownership issue with the next @catch not
being serialized as an owned pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46647 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/StmtSerialization.cpp b/AST/StmtSerialization.cpp
index 227f365..9a03a53 100644
--- a/AST/StmtSerialization.cpp
+++ b/AST/StmtSerialization.cpp
@@ -859,8 +859,7 @@
void ObjCAtCatchStmt::EmitImpl(Serializer& S) const {
S.Emit(AtCatchLoc);
S.Emit(RParenLoc);
- S.EmitPtr(NextAtCatchStmt);
- S.BatchEmitOwnedPtrs((unsigned) END_EXPR,&SubExprs[0]);
+ S.BatchEmitOwnedPtrs((unsigned) END_EXPR, &SubExprs[0]);
}
ObjCAtCatchStmt* ObjCAtCatchStmt::CreateImpl(Deserializer& D) {
@@ -868,8 +867,6 @@
SourceLocation RParenLoc = SourceLocation::ReadVal(D);
ObjCAtCatchStmt* stmt = new ObjCAtCatchStmt(AtCatchLoc,RParenLoc);
-
- D.ReadPtr(stmt->NextAtCatchStmt); // Allows backpatching.
D.BatchReadOwnedPtrs((unsigned) END_EXPR, &stmt->SubExprs[0]);
return stmt;