mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
Handle unindexed instructions in SlotIndices.
SlotIndexes::insertMachineInstrInMaps would crash when trying to insert an instruction imediately after an unmapped debug value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107504 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -663,15 +663,20 @@ namespace llvm {
|
|||||||
MachineBasicBlock::iterator miItr(mi);
|
MachineBasicBlock::iterator miItr(mi);
|
||||||
bool needRenumber = false;
|
bool needRenumber = false;
|
||||||
IndexListEntry *newEntry;
|
IndexListEntry *newEntry;
|
||||||
|
// Get previous index, considering that not all instructions are indexed.
|
||||||
IndexListEntry *prevEntry;
|
IndexListEntry *prevEntry;
|
||||||
if (miItr == mbb->begin()) {
|
for (;;) {
|
||||||
// If mi is at the mbb beginning, get the prev index from the mbb.
|
// If mi is at the mbb beginning, get the prev index from the mbb.
|
||||||
prevEntry = &mbbRangeItr->second.first.entry();
|
if (miItr == mbb->begin()) {
|
||||||
} else {
|
prevEntry = &mbbRangeItr->second.first.entry();
|
||||||
// Otherwise get it from the previous instr.
|
break;
|
||||||
MachineBasicBlock::iterator pItr(prior(miItr));
|
}
|
||||||
prevEntry = &getInstructionIndex(pItr).entry();
|
// Otherwise rewind until we find a mapped instruction.
|
||||||
|
Mi2IndexMap::const_iterator itr = mi2iMap.find(--miItr);
|
||||||
|
if (itr != mi2iMap.end()) {
|
||||||
|
prevEntry = &itr->second.entry();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get next entry from previous entry.
|
// Get next entry from previous entry.
|
||||||
|
Reference in New Issue
Block a user