[cfe-commits] r56101 - in /cfe/trunk/lib/CodeGen: CGObjC.cpp CGObjCMac.cpp CGStmt.cpp CodeGenFunction.h
Anders Carlsson
andersca at mac.com
Thu Sep 11 01:21:55 PDT 2008
Author: andersca
Date: Thu Sep 11 03:21:54 2008
New Revision: 56101
URL: http://llvm.org/viewvc/llvm-project?rev=56101&view=rev
Log:
Make sure to emit the catch parameter as well as the catch body.
Modified:
cfe/trunk/lib/CodeGen/CGObjC.cpp
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
cfe/trunk/lib/CodeGen/CGStmt.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.h
Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=56101&r1=56100&r2=56101&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Thu Sep 11 03:21:54 2008
@@ -456,4 +456,12 @@
CGM.getObjCRuntime().EmitThrowStmt(*this, S);
}
+void CodeGenFunction::EmitObjCAtCatchStmt(const ObjCAtCatchStmt &S)
+{
+ if (const Stmt *CatchParam = S.getCatchParamStmt())
+ EmitStmt(CatchParam);
+
+ EmitStmt(S.getCatchBody());
+}
+
CGObjCRuntime::~CGObjCRuntime() {}
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=56101&r1=56100&r2=56101&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Thu Sep 11 03:21:54 2008
@@ -1459,8 +1459,9 @@
MatchesAll = true;
}
- if (MatchesAll) {
- CGF.EmitStmt(CatchStmt->getCatchBody());
+ if (MatchesAll) {
+ CGF.EmitStmt(CatchStmt);
+
CGF.Builder.CreateBr(FinallyBlock);
CGF.EmitBlock(NextCatchBlock);
@@ -1485,7 +1486,7 @@
// Emit the @catch block.
CGF.EmitBlock(MatchedBlock);
- CGF.EmitStmt(CatchStmt->getCatchBody());
+ CGF.EmitStmt(CatchStmt);
CGF.Builder.CreateBr(FinallyBlock);
CGF.EmitBlock(NextCatchBlock);
Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=56101&r1=56100&r2=56101&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Thu Sep 11 03:21:54 2008
@@ -81,8 +81,8 @@
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;
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=56101&r1=56100&r2=56101&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Thu Sep 11 03:21:54 2008
@@ -269,6 +269,7 @@
void EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S);
void EmitObjCAtTryStmt(const ObjCAtTryStmt &S);
+ void EmitObjCAtCatchStmt(const ObjCAtCatchStmt &S);
void EmitObjCAtThrowStmt(const ObjCAtThrowStmt &S);
//===--------------------------------------------------------------------===//
More information about the cfe-commits
mailing list