General cleanup

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1628 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-02-01 04:53:48 +00:00
parent 6ff53e77cc
commit 417cf7ef96

View File

@ -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) {