diff options
author | Matthias Braun <matze@braunis.de> | 2015-08-24 22:59:52 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2015-08-24 22:59:52 +0000 |
commit | b2b7ef1de8118095963e1c085467fc411bd7e56f (patch) | |
tree | 10da40c76c37d53e59e8197182bd65cfffde9301 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 008ff14acf9ce39d855dbeeb622e0598bbad0d93 (diff) | |
download | bcm5719-llvm-b2b7ef1de8118095963e1c085467fc411bd7e56f.tar.gz bcm5719-llvm-b2b7ef1de8118095963e1c085467fc411bd7e56f.zip |
MachineBasicBlock: Add liveins() method returning an iterator_range
llvm-svn: 245895
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 9d81ee6f339..0c070321369 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -278,8 +278,9 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST, if (!livein_empty()) { if (Indexes) OS << '\t'; OS << " Live Ins:"; - for (livein_iterator I = livein_begin(),E = livein_end(); I != E; ++I) - OS << ' ' << PrintReg(*I, TRI); + for (unsigned LI : make_range(livein_begin(), livein_end())) { + OS << ' ' << PrintReg(LI, TRI); + } OS << '\n'; } // Print the preds of this block according to the CFG. @@ -322,8 +323,7 @@ void MachineBasicBlock::printAsOperand(raw_ostream &OS, } void MachineBasicBlock::removeLiveIn(unsigned Reg) { - std::vector<unsigned>::iterator I = - std::find(LiveIns.begin(), LiveIns.end(), Reg); + livein_iterator I = std::find(LiveIns.begin(), LiveIns.end(), Reg); if (I != LiveIns.end()) LiveIns.erase(I); } @@ -804,9 +804,8 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) { i->getOperand(ni+1).setMBB(NMBB); // Inherit live-ins from the successor - for (MachineBasicBlock::livein_iterator I = Succ->livein_begin(), - E = Succ->livein_end(); I != E; ++I) - NMBB->addLiveIn(*I); + for (unsigned LI : Succ->liveins()) + NMBB->addLiveIn(LI); // Update LiveVariables. const TargetRegisterInfo *TRI = MF->getSubtarget().getRegisterInfo(); |