mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
General cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1628 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6ff53e77cc
commit
417cf7ef96
@ -23,16 +23,15 @@ AnalysisID UnifyMethodExitNodes::ID(AnalysisID::create<UnifyMethodExitNodes>());
|
|||||||
// If there are no return stmts in the Method, a null pointer is returned.
|
// If there are no return stmts in the Method, a null pointer is returned.
|
||||||
//
|
//
|
||||||
bool UnifyMethodExitNodes::doit(Method *M, BasicBlock *&ExitNode) {
|
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
|
// Loop over all of the blocks in a method, tracking all of the blocks that
|
||||||
// return.
|
// return.
|
||||||
//
|
//
|
||||||
|
vector<BasicBlock*> ReturningBlocks;
|
||||||
for(Method::iterator I = M->begin(), E = M->end(); I != E; ++I)
|
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);
|
ReturningBlocks.push_back(*I);
|
||||||
|
|
||||||
if (ReturningBlocks.size() == 0) {
|
if (ReturningBlocks.empty()) {
|
||||||
ExitNode = 0;
|
ExitNode = 0;
|
||||||
return false; // No blocks return
|
return false; // No blocks return
|
||||||
} else if (ReturningBlocks.size() == 1) {
|
} else if (ReturningBlocks.size() == 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user