#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/raw_ostream.h"
using namespace llvm;
// Explicitly instantiate methods in LoopInfoImpl.h for MI-level Loops.
bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) {
releaseMemory();
- LI.Analyze(getAnalysis<MachineDominatorTree>().getBase());
+ LI.analyze(getAnalysis<MachineDominatorTree>().getBase());
return false;
}
MachineBasicBlock *TopMBB = getHeader();
MachineFunction::iterator Begin = TopMBB->getParent()->begin();
if (TopMBB != Begin) {
- MachineBasicBlock *PriorMBB = prior(MachineFunction::iterator(TopMBB));
+ MachineBasicBlock *PriorMBB = &*std::prev(TopMBB->getIterator());
while (contains(PriorMBB)) {
TopMBB = PriorMBB;
if (TopMBB == Begin) break;
- PriorMBB = prior(MachineFunction::iterator(TopMBB));
+ PriorMBB = &*std::prev(TopMBB->getIterator());
}
}
return TopMBB;
MachineBasicBlock *MachineLoop::getBottomBlock() {
MachineBasicBlock *BotMBB = getHeader();
MachineFunction::iterator End = BotMBB->getParent()->end();
- if (BotMBB != prior(End)) {
- MachineBasicBlock *NextMBB = llvm::next(MachineFunction::iterator(BotMBB));
+ if (BotMBB != std::prev(End)) {
+ MachineBasicBlock *NextMBB = &*std::next(BotMBB->getIterator());
while (contains(NextMBB)) {
BotMBB = NextMBB;
- if (BotMBB == llvm::next(MachineFunction::iterator(BotMBB))) break;
- NextMBB = llvm::next(MachineFunction::iterator(BotMBB));
+ if (BotMBB == &*std::next(BotMBB->getIterator()))
+ break;
+ NextMBB = &*std::next(BotMBB->getIterator());
}
}
return BotMBB;