summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/PruneEH.cpp
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
commitee5457cbe88b7f691f774de8515d9a94226d1b00 (patch)
treeac7e19c81aba3447b8446f1b4d29c5f5e6db01b8 /lib/Transforms/IPO/PruneEH.cpp
parentda73beac201091653d9e2b900d2207c31ed97a0e (diff)
downloadllvm-ee5457cbe88b7f691f774de8515d9a94226d1b00.tar.gz
llvm-ee5457cbe88b7f691f774de8515d9a94226d1b00.tar.bz2
llvm-ee5457cbe88b7f691f774de8515d9a94226d1b00.tar.xz
Eliminate support for the llvm.unwind intrinisic, using the Unwind instruction instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8411 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/PruneEH.cpp')
-rw-r--r--lib/Transforms/IPO/PruneEH.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp
index 41f7f73845..8be8761b85 100644
--- a/lib/Transforms/IPO/PruneEH.cpp
+++ b/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;