1//===- MachineLoopInfo.cpp - Natural Loop Calculator ----------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 48 unchanged lines hidden (view full) --- 57 } 58 return TopMBB; 59} 60 61MachineBasicBlock *MachineLoop::getBottomBlock() { 62 MachineBasicBlock *BotMBB = getHeader(); 63 MachineFunction::iterator End = BotMBB->getParent()->end(); 64 if (BotMBB != prior(End)) { |
65 MachineBasicBlock *NextMBB = llvm::next(MachineFunction::iterator(BotMBB)); |
66 while (contains(NextMBB)) { 67 BotMBB = NextMBB; |
68 if (BotMBB == llvm::next(MachineFunction::iterator(BotMBB))) break; 69 NextMBB = llvm::next(MachineFunction::iterator(BotMBB)); |
70 } 71 } 72 return BotMBB; 73} |