[llvm-commits] CVS: llvm/lib/Transforms/IPO/PruneEH.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Sep 8 14:45:08 PDT 2003


Changes in directory llvm/lib/Transforms/IPO:

PruneEH.cpp updated: 1.2 -> 1.3

---
Log message:

Eliminate support for the llvm.unwind intrinisic, using the Unwind instruction instead


---
Diffs of the changes:

Index: llvm/lib/Transforms/IPO/PruneEH.cpp
diff -u llvm/lib/Transforms/IPO/PruneEH.cpp:1.2 llvm/lib/Transforms/IPO/PruneEH.cpp:1.3
--- llvm/lib/Transforms/IPO/PruneEH.cpp:1.2	Sun Aug 31 11:30:07 2003
+++ llvm/lib/Transforms/IPO/PruneEH.cpp	Mon Sep  8 14:44:23 2003
@@ -38,7 +38,7 @@
 
   // First, check to see if any callees might throw or if there are any external
   // functions in this SCC: if so, we cannot prune any functions in this SCC.
-  // If this SCC includes the llvm.unwind intrinsic, we KNOW it throws, so
+  // If this SCC includes the unwind instruction, we KNOW it throws, so
   // obviously the SCC might throw.
   //
   bool SCCMightThrow = false;
@@ -48,10 +48,11 @@
         std::find(SCC.begin(), SCC.end(), SCC[i]) == SCC.end()) {
       SCCMightThrow = true; break;
     } else if (Function *F = SCC[i]->getFunction())
-      if (F->isExternal() ||                             // Is external function
-          F->getIntrinsicID() == LLVMIntrinsic::unwind) {// Is unwind function!
-        SCCMightThrow = true; break;
-      }
+      if (!F->isExternal())
+        for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I)
+          if (isa<UnwindInst>(I->getTerminator())) {  // Uses unwind!
+            SCCMightThrow = true; break;
+          }
 
   bool MadeChange = false;
 





More information about the llvm-commits mailing list