diff options
author | Mike Stump <mrs@apple.com> | 2009-12-04 19:21:57 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-12-04 19:21:57 +0000 |
commit | 875912ac13e67729b175e09e19962dda6dd34dfc (patch) | |
tree | 53c85d8a2c917ab53670e2da3cf30f7b0ab78f9e /clang/lib/CodeGen/CGException.cpp | |
parent | 9e6725574830c7bdd6e5a5a79f906d33f4423280 (diff) | |
download | bcm5719-llvm-875912ac13e67729b175e09e19962dda6dd34dfc.tar.gz bcm5719-llvm-875912ac13e67729b175e09e19962dda6dd34dfc.zip |
Fixup nested try blocks.
llvm-svn: 90576
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 3de300445c9..62064ecf41c 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -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); |