/// FunctionSize - The number of instructions present in the function
uint64_t FunctionSize;
- typedef DenseMap<MachineInstr*, unsigned> Mi2IndexMap;
+ typedef DenseMap<const MachineInstr*, unsigned> Mi2IndexMap;
Mi2IndexMap mi2iMap_;
typedef std::vector<MachineInstr*> Index2MiMap;
}
/// getInstructionIndex - returns the base index of instr
- unsigned getInstructionIndex(MachineInstr* instr) const {
+ unsigned getInstructionIndex(const MachineInstr* instr) const {
Mi2IndexMap::const_iterator it = mi2iMap_.find(instr);
assert(it != mi2iMap_.end() && "Invalid instruction!");
return it->second;
i2miMap_.resize(highestSlot + 1);
for (Mi2IndexMap::iterator MI = mi2iMap_.begin(), ME = mi2iMap_.end();
MI != ME; ++MI) {
- i2miMap_[MI->second] = MI->first;
+ i2miMap_[MI->second] = const_cast<MachineInstr *>(MI->first);
}
}