diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-02-06 21:16:41 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-02-06 21:16:41 +0000 |
commit | d5d95b0b510a1cf6b4b72b444649178113bd05bd (patch) | |
tree | bda4a63191623f1cc7339aa065478215398764e7 /llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp | |
parent | a2791f8aeb2ea2b439c7a8cbb4bd2fe781f21c34 (diff) | |
download | bcm5719-llvm-d5d95b0b510a1cf6b4b72b444649178113bd05bd.tar.gz bcm5719-llvm-d5d95b0b510a1cf6b4b72b444649178113bd05bd.zip |
[unwind removal] We no longer have 'unwind' instructions being generated, so
remove the code that handles them.
llvm-svn: 149901
Diffstat (limited to 'llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp index 46d4adaaa15..b1cad06dffe 100644 --- a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp +++ b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp @@ -50,33 +50,13 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) { // return. // std::vector<BasicBlock*> ReturningBlocks; - std::vector<BasicBlock*> UnwindingBlocks; std::vector<BasicBlock*> UnreachableBlocks; for(Function::iterator I = F.begin(), E = F.end(); I != E; ++I) if (isa<ReturnInst>(I->getTerminator())) ReturningBlocks.push_back(I); - else if (isa<UnwindInst>(I->getTerminator())) - UnwindingBlocks.push_back(I); else if (isa<UnreachableInst>(I->getTerminator())) UnreachableBlocks.push_back(I); - // Handle unwinding blocks first. - if (UnwindingBlocks.empty()) { - UnwindBlock = 0; - } else if (UnwindingBlocks.size() == 1) { - UnwindBlock = UnwindingBlocks.front(); - } else { - UnwindBlock = BasicBlock::Create(F.getContext(), "UnifiedUnwindBlock", &F); - new UnwindInst(F.getContext(), UnwindBlock); - - for (std::vector<BasicBlock*>::iterator I = UnwindingBlocks.begin(), - E = UnwindingBlocks.end(); I != E; ++I) { - BasicBlock *BB = *I; - BB->getInstList().pop_back(); // Remove the unwind insn - BranchInst::Create(UnwindBlock, BB); - } - } - // Then unreachable blocks. if (UnreachableBlocks.empty()) { UnreachableBlock = 0; |