mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 19:31:58 +00:00
Eliminate MachineBasicBlock::const_livein_iterator and make
MachineBasicBlock::livein_iterator a const_iterator, because clients shouldn't ever be using the iterator interface to mutate the livein set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101147 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9e9aa44d1a
commit
81bf03eb5c
@ -201,12 +201,9 @@ public:
|
||||
|
||||
// Iteration support for live in sets. These sets are kept in sorted
|
||||
// order by their register number.
|
||||
typedef std::vector<unsigned>::iterator livein_iterator;
|
||||
typedef std::vector<unsigned>::const_iterator const_livein_iterator;
|
||||
livein_iterator livein_begin() { return LiveIns.begin(); }
|
||||
const_livein_iterator livein_begin() const { return LiveIns.begin(); }
|
||||
livein_iterator livein_end() { return LiveIns.end(); }
|
||||
const_livein_iterator livein_end() const { return LiveIns.end(); }
|
||||
typedef std::vector<unsigned>::const_iterator livein_iterator;
|
||||
livein_iterator livein_begin() const { return LiveIns.begin(); }
|
||||
livein_iterator livein_end() const { return LiveIns.end(); }
|
||||
bool livein_empty() const { return LiveIns.empty(); }
|
||||
|
||||
/// getAlignment - Return alignment of the basic block.
|
||||
|
@ -668,7 +668,7 @@ void LiveIntervals::computeIntervals() {
|
||||
DEBUG(dbgs() << MBB->getName() << ":\n");
|
||||
|
||||
// Create intervals for live-ins to this BB first.
|
||||
for (MachineBasicBlock::const_livein_iterator LI = MBB->livein_begin(),
|
||||
for (MachineBasicBlock::livein_iterator LI = MBB->livein_begin(),
|
||||
LE = MBB->livein_end(); LI != LE; ++LI) {
|
||||
handleLiveInRegister(MBB, MIIndex, getOrCreateInterval(*LI));
|
||||
// Multiple live-ins can alias the same register.
|
||||
|
@ -531,7 +531,7 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &mf) {
|
||||
|
||||
// Mark live-in registers as live-in.
|
||||
SmallVector<unsigned, 4> Defs;
|
||||
for (MachineBasicBlock::const_livein_iterator II = MBB->livein_begin(),
|
||||
for (MachineBasicBlock::livein_iterator II = MBB->livein_begin(),
|
||||
EE = MBB->livein_end(); II != EE; ++II) {
|
||||
assert(TargetRegisterInfo::isPhysicalRegister(*II) &&
|
||||
"Cannot have a live-in virtual register!");
|
||||
|
@ -191,7 +191,7 @@ void MachineBasicBlock::print(raw_ostream &OS) const {
|
||||
const TargetRegisterInfo *TRI = MF->getTarget().getRegisterInfo();
|
||||
if (!livein_empty()) {
|
||||
OS << " Live Ins:";
|
||||
for (const_livein_iterator I = livein_begin(),E = livein_end(); I != E; ++I)
|
||||
for (livein_iterator I = livein_begin(),E = livein_end(); I != E; ++I)
|
||||
OutputReg(OS, *I, TRI);
|
||||
OS << '\n';
|
||||
}
|
||||
@ -218,13 +218,14 @@ void MachineBasicBlock::print(raw_ostream &OS) const {
|
||||
}
|
||||
|
||||
void MachineBasicBlock::removeLiveIn(unsigned Reg) {
|
||||
livein_iterator I = std::find(livein_begin(), livein_end(), Reg);
|
||||
assert(I != livein_end() && "Not a live in!");
|
||||
std::vector<unsigned>::iterator I =
|
||||
std::find(LiveIns.begin(), LiveIns.end(), Reg);
|
||||
assert(I != LiveIns.end() && "Not a live in!");
|
||||
LiveIns.erase(I);
|
||||
}
|
||||
|
||||
bool MachineBasicBlock::isLiveIn(unsigned Reg) const {
|
||||
const_livein_iterator I = std::find(livein_begin(), livein_end(), Reg);
|
||||
livein_iterator I = std::find(livein_begin(), livein_end(), Reg);
|
||||
return I != livein_end();
|
||||
}
|
||||
|
||||
|
@ -360,7 +360,7 @@ void MachineLICM::HoistRegionPostRA(MachineDomTreeNode *N) {
|
||||
// Conservatively treat live-in's as an external def.
|
||||
// FIXME: That means a reload that're reused in successor block(s) will not
|
||||
// be LICM'ed.
|
||||
for (MachineBasicBlock::const_livein_iterator I = BB->livein_begin(),
|
||||
for (MachineBasicBlock::livein_iterator I = BB->livein_begin(),
|
||||
E = BB->livein_end(); I != E; ++I) {
|
||||
unsigned Reg = *I;
|
||||
++PhysRegDefs[Reg];
|
||||
|
@ -470,7 +470,7 @@ MachineVerifier::visitMachineBasicBlockBefore(const MachineBasicBlock *MBB) {
|
||||
}
|
||||
|
||||
regsLive.clear();
|
||||
for (MachineBasicBlock::const_livein_iterator I = MBB->livein_begin(),
|
||||
for (MachineBasicBlock::livein_iterator I = MBB->livein_begin(),
|
||||
E = MBB->livein_end(); I != E; ++I) {
|
||||
if (!TargetRegisterInfo::isPhysicalRegister(*I)) {
|
||||
report("MBB live-in list contains non-physical register", MBB);
|
||||
|
@ -64,7 +64,7 @@ void RegScavenger::initRegState() {
|
||||
return;
|
||||
|
||||
// Live-in registers are in use.
|
||||
for (MachineBasicBlock::const_livein_iterator I = MBB->livein_begin(),
|
||||
for (MachineBasicBlock::livein_iterator I = MBB->livein_begin(),
|
||||
E = MBB->livein_end(); I != E; ++I)
|
||||
setUsed(*I);
|
||||
|
||||
|
@ -270,7 +270,7 @@ bool SSEDomainFixPass::Merge(DomainValue *A, DomainValue *B) {
|
||||
|
||||
void SSEDomainFixPass::enterBasicBlock() {
|
||||
// Try to coalesce live-out registers from predecessors.
|
||||
for (MachineBasicBlock::const_livein_iterator i = MBB->livein_begin(),
|
||||
for (MachineBasicBlock::livein_iterator i = MBB->livein_begin(),
|
||||
e = MBB->livein_end(); i != e; ++i) {
|
||||
int rx = RegIndex(*i);
|
||||
if (rx < 0) continue;
|
||||
|
Loading…
Reference in New Issue
Block a user