diff options
author | Chris Lattner <sabre@nondot.org> | 2002-02-01 04:53:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-02-01 04:53:48 +0000 |
commit | 417cf7ef96ffcf81f5ca6c48639c804c2aa68bce (patch) | |
tree | 3de40259a3d50f8df297208d2b3c41553276fd43 | |
parent | 6ff53e77ccb86cfda1760de6cb90b47f2d55a365 (diff) | |
download | external_llvm-417cf7ef96ffcf81f5ca6c48639c804c2aa68bce.zip external_llvm-417cf7ef96ffcf81f5ca6c48639c804c2aa68bce.tar.gz external_llvm-417cf7ef96ffcf81f5ca6c48639c804c2aa68bce.tar.bz2 |
General cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1628 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Utils/UnifyFunctionExitNodes.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp b/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp index 15e37e3..da7b1f6 100644 --- a/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp +++ b/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp @@ -23,16 +23,15 @@ AnalysisID UnifyMethodExitNodes::ID(AnalysisID::create<UnifyMethodExitNodes>()); // If there are no return stmts in the Method, a null pointer is returned. // bool UnifyMethodExitNodes::doit(Method *M, BasicBlock *&ExitNode) { - vector<BasicBlock*> ReturningBlocks; - // Loop over all of the blocks in a method, tracking all of the blocks that // return. // + vector<BasicBlock*> ReturningBlocks; for(Method::iterator I = M->begin(), E = M->end(); I != E; ++I) - if ((*I)->getTerminator()->getOpcode() == Instruction::Ret) + if (isa<ReturnInst>((*I)->getTerminator())) ReturningBlocks.push_back(*I); - if (ReturningBlocks.size() == 0) { + if (ReturningBlocks.empty()) { ExitNode = 0; return false; // No blocks return } else if (ReturningBlocks.size() == 1) { |