summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-08 19:44:26 +0000
committerChris Lattner <sabre@nondot.org>2003-09-08 19:44:26 +0000
commit04ecefe2325871f70c89ee7e2a6bda34e0c006b6 (patch)
tree63803e7edc31c6197861e1534488543d1992c67a /llvm/lib/Transforms/IPO
parent0b792b4ed345295214583991a27b692b3c6bd1bb (diff)
downloadbcm5719-llvm-04ecefe2325871f70c89ee7e2a6bda34e0c006b6.tar.gz
bcm5719-llvm-04ecefe2325871f70c89ee7e2a6bda34e0c006b6.zip
Eliminate support for the llvm.unwind intrinisic, using the Unwind instruction instead
llvm-svn: 8411
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/PruneEH.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/IPO/PruneEH.cpp b/llvm/lib/Transforms/IPO/PruneEH.cpp
index 41f7f73845c..8be8761b853 100644
--- a/llvm/lib/Transforms/IPO/PruneEH.cpp
+++ b/llvm/lib/Transforms/IPO/PruneEH.cpp
@@ -38,7 +38,7 @@ bool PruneEH::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
// 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 @@ bool PruneEH::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
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;
OpenPOWER on IntegriCloud