rethrow is really the language independent primitive here. "throw" can be written
authorChris Lattner <sabre@nondot.org>
Sun, 24 Aug 2003 12:24:11 +0000 (12:24 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 24 Aug 2003 12:24:11 +0000 (12:24 +0000)
in terms of it and llvm.exc.setcurrent.
Rework the intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8111 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/InlineFunction.cpp

index fade863bb82c0d8ae1bfcb740afd62c47081680f..017fbe1cca326b1b4b49a15ab2b606f82b7b85b7 100644 (file)
@@ -191,12 +191,12 @@ bool InlineFunction(CallSite CS) {
           
           if (Function *F = CI->getCalledFunction())
             if (unsigned ID = F->getIntrinsicID())
-              if (ID == LLVMIntrinsic::exc_rethrow) {
-                // llvm.exc.rethrow requires special handling when it gets
-                // inlined into an invoke site.  Once this happens, we know that
-                // the rethrow would cause a control transfer to the invoke
-                // exception destination, so we can transform it into a direct
-                // branch to the exception destination.
+              if (ID == LLVMIntrinsic::unwind) {
+                // llvm.unwind requires special handling when it gets inlined
+                // into an invoke site.  Once this happens, we know that the
+                // unwind would cause a control transfer to the invoke exception
+                // destination, so we can transform it into a direct branch to
+                // the exception destination.
                 BranchInst *BI = new BranchInst(InvokeDest, CI);
 
                 // Note that since any instructions after the rethrow/branch are
@@ -211,7 +211,7 @@ bool InlineFunction(CallSite CS) {
                 }
 
                 break;  // Done with this basic block!
-              } else if (ID == LLVMIntrinsic::exc_throw ||
+              } else if (ID == LLVMIntrinsic::exc_setcurrent ||
                          ID == LLVMIntrinsic::exc_getcurrent) {
                 ShouldInvokify = false; // Not correct to invokify exc.throw!
               }