mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-15 06:25:53 +00:00
Iterate backwards over debug locations when splitting them so they can be safely erased.
This should unbreak dragonegg-i386-linux and build-self-4-mingw32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131007 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -795,7 +795,10 @@ UserValue::splitLocation(unsigned OldLocNo, ArrayRef<LiveInterval*> NewRegs) {
|
|||||||
bool
|
bool
|
||||||
UserValue::splitRegister(unsigned OldReg, ArrayRef<LiveInterval*> NewRegs) {
|
UserValue::splitRegister(unsigned OldReg, ArrayRef<LiveInterval*> NewRegs) {
|
||||||
bool DidChange = false;
|
bool DidChange = false;
|
||||||
for (unsigned LocNo = 0, E = locations.size(); LocNo != E; ++LocNo) {
|
// Split locations referring to OldReg. Iterate backwards so splitLocation can
|
||||||
|
// safely erase unuused locations.
|
||||||
|
for (unsigned i = locations.size(); i ; --i) {
|
||||||
|
unsigned LocNo = i-1;
|
||||||
const MachineOperand *Loc = &locations[LocNo];
|
const MachineOperand *Loc = &locations[LocNo];
|
||||||
if (!Loc->isReg() || Loc->getReg() != OldReg)
|
if (!Loc->isReg() || Loc->getReg() != OldReg)
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user