[cfe-commits] r90576 - /cfe/trunk/lib/CodeGen/CGException.cpp

Mike Stump mrs at apple.com
Fri Dec 4 11:21:58 PST 2009


Author: mrs
Date: Fri Dec  4 13:21:57 2009
New Revision: 90576

URL: http://llvm.org/viewvc/llvm-project?rev=90576&view=rev
Log:
Fixup nested try blocks.

Modified:
    cfe/trunk/lib/CodeGen/CGException.cpp

Modified: cfe/trunk/lib/CodeGen/CGException.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGException.cpp?rev=90576&r1=90575&r2=90576&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGException.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGException.cpp Fri Dec  4 13:21:57 2009
@@ -481,8 +481,18 @@
   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);





More information about the cfe-commits mailing list