CGM.getObjCRuntime().EmitThrowStmt(*this, S);
}
+void CodeGenFunction::EmitObjCAtCatchStmt(const ObjCAtCatchStmt &S)
+{
+ if (const Stmt *CatchParam = S.getCatchParamStmt())
+ EmitStmt(CatchParam);
+
+ EmitStmt(S.getCatchBody());
+}
+
CGObjCRuntime::~CGObjCRuntime() {}
MatchesAll = true;
}
- if (MatchesAll) {
- CGF.EmitStmt(CatchStmt->getCatchBody());
+ if (MatchesAll) {
+ CGF.EmitStmt(CatchStmt);
+
CGF.Builder.CreateBr(FinallyBlock);
CGF.EmitBlock(NextCatchBlock);
// Emit the @catch block.
CGF.EmitBlock(MatchedBlock);
- CGF.EmitStmt(CatchStmt->getCatchBody());
+ CGF.EmitStmt(CatchStmt);
CGF.Builder.CreateBr(FinallyBlock);
CGF.EmitBlock(NextCatchBlock);
EmitObjCAtTryStmt(cast<ObjCAtTryStmt>(*S));
break;
case Stmt::ObjCAtCatchStmtClass:
- assert(0 && "@catch statements should be handled by EmitObjCAtTryStmt");
- break;
+ EmitObjCAtCatchStmt(cast<ObjCAtCatchStmt>(*S));
+ break;
case Stmt::ObjCAtFinallyStmtClass:
assert(0 && "@finally statements should be handled by EmitObjCAtTryStmt");
break;
void EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S);
void EmitObjCAtTryStmt(const ObjCAtTryStmt &S);
+ void EmitObjCAtCatchStmt(const ObjCAtCatchStmt &S);
void EmitObjCAtThrowStmt(const ObjCAtThrowStmt &S);
//===--------------------------------------------------------------------===//