mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 11:15:29 -04:00
MachineBasicBlock: Add liveins() method returning an iterator_range
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245895 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user