[llvm-commits] CVS: llvm/lib/Transforms/Utils/InlineFunction.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Aug 24 07:25:01 PDT 2003


Changes in directory llvm/lib/Transforms/Utils:

InlineFunction.cpp updated: 1.3 -> 1.4

---
Log message:

rethrow is really the language independent primitive here.  "throw" can be written
in terms of it and llvm.exc.setcurrent.
Rework the intrinsics.


---
Diffs of the changes:

Index: llvm/lib/Transforms/Utils/InlineFunction.cpp
diff -u llvm/lib/Transforms/Utils/InlineFunction.cpp:1.3 llvm/lib/Transforms/Utils/InlineFunction.cpp:1.4
--- llvm/lib/Transforms/Utils/InlineFunction.cpp:1.3	Sun Aug 24 01:59:16 2003
+++ llvm/lib/Transforms/Utils/InlineFunction.cpp	Sun Aug 24 07:24:11 2003
@@ -191,12 +191,12 @@
           
           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 @@
                 }
 
                 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!
               }





More information about the llvm-commits mailing list