From 43ed40891240da5a14dbf54c8ca5f9d4031d454b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 1 Feb 2002 04:53:48 +0000 Subject: [PATCH] General cleanup llvm-svn: 1628 --- lib/Transforms/Utils/UnifyFunctionExitNodes.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp b/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp index 15e37e39933..da7b1f609ae 100644 --- a/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp +++ b/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp @@ -23,16 +23,15 @@ AnalysisID UnifyMethodExitNodes::ID(AnalysisID::create()); // If there are no return stmts in the Method, a null pointer is returned. // bool UnifyMethodExitNodes::doit(Method *M, BasicBlock *&ExitNode) { - vector ReturningBlocks; - // Loop over all of the blocks in a method, tracking all of the blocks that // return. // + vector ReturningBlocks; for(Method::iterator I = M->begin(), E = M->end(); I != E; ++I) - if ((*I)->getTerminator()->getOpcode() == Instruction::Ret) + if (isa((*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) {