Fixup nested try blocks.

llvm-svn: 90576
This commit is contained in:
Mike Stump 2009-12-04 19:21:57 +00:00
parent 9e67255748
commit 875912ac13
1 changed files with 12 additions and 2 deletions

View File

@ -481,8 +481,18 @@ void CodeGenFunction::EmitCXXTryStmt(const CXXTryStmt &S) {
EmitBranch(FinallyEnd);
EmitBlock(FinallyRethrow);
Builder.CreateCall(getUnwindResumeOrRethrowFn(*this),
Builder.CreateLoad(RethrowPtr));
// FIXME: Eventually we can chain the handlers together and just do a call
// here.
if (getInvokeDest()) {
llvm::BasicBlock *Cont = createBasicBlock("invoke.cont");
Builder.CreateInvoke(getUnwindResumeOrRethrowFn(*this), Cont,
getInvokeDest(),
Builder.CreateLoad(RethrowPtr));
EmitBlock(Cont);
} else
Builder.CreateCall(getUnwindResumeOrRethrowFn(*this),
Builder.CreateLoad(RethrowPtr));
Builder.CreateUnreachable();
EmitBlock(FinallyEnd);