aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/SlotIndexes.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen/SlotIndexes.h')
-rw-r--r--include/llvm/CodeGen/SlotIndexes.h22
1 files changed, 9 insertions, 13 deletions
diff --git a/include/llvm/CodeGen/SlotIndexes.h b/include/llvm/CodeGen/SlotIndexes.h
index 2ac3b3d86cb6..14fc3a499a08 100644
--- a/include/llvm/CodeGen/SlotIndexes.h
+++ b/include/llvm/CodeGen/SlotIndexes.h
@@ -602,19 +602,15 @@ namespace llvm {
return newIndex;
}
- /// Remove the given machine instruction from the mapping.
- void removeMachineInstrFromMaps(MachineInstr &MI) {
- // remove index -> MachineInstr and
- // MachineInstr -> index mappings
- Mi2IndexMap::iterator mi2iItr = mi2iMap.find(&MI);
- if (mi2iItr != mi2iMap.end()) {
- IndexListEntry *miEntry(mi2iItr->second.listEntry());
- assert(miEntry->getInstr() == &MI && "Instruction indexes broken.");
- // FIXME: Eventually we want to actually delete these indexes.
- miEntry->setInstr(nullptr);
- mi2iMap.erase(mi2iItr);
- }
- }
+ /// Removes machine instruction (bundle) \p MI from the mapping.
+ /// This should be called before MachineInstr::eraseFromParent() is used to
+ /// remove a whole bundle or an unbundled instruction.
+ void removeMachineInstrFromMaps(MachineInstr &MI);
+
+ /// Removes a single machine instruction \p MI from the mapping.
+ /// This should be called before MachineInstr::eraseFromBundle() is used to
+ /// remove a single instruction (out of a bundle).
+ void removeSingleMachineInstrFromMaps(MachineInstr &MI);
/// ReplaceMachineInstrInMaps - Replacing a machine instr with a new one in
/// maps used by register allocator. \returns the index where the new