General cleanup

llvm-svn: 1628
This commit is contained in:
Chris Lattner 2002-02-01 04:53:48 +00:00
parent f2f31bdfb5
commit 86595ae342
1 changed files with 3 additions and 4 deletions

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