@@ -262,7 +262,7 @@ unsigned StackColoring::collectMarkers(unsigned NumSlot) {
262
262
Markers.push_back (BI);
263
263
264
264
bool IsStart = BI->getOpcode () == TargetOpcode::LIFETIME_START;
265
- MachineOperand &MI = BI->getOperand (0 );
265
+ const MachineOperand &MI = BI->getOperand (0 );
266
266
unsigned Slot = MI.getIndex ();
267
267
268
268
MarkersFound++;
@@ -401,9 +401,9 @@ void StackColoring::calculateLiveIntervals(unsigned NumSlots) {
401
401
Finishes.resize (NumSlots);
402
402
403
403
// Create the interval for the basic blocks with lifetime markers in them.
404
- for (SmallVector <MachineInstr*, 8 >::iterator it = Markers.begin (),
404
+ for (SmallVectorImpl <MachineInstr*>::const_iterator it = Markers.begin (),
405
405
e = Markers.end (); it != e; ++it) {
406
- MachineInstr *MI = *it;
406
+ const MachineInstr *MI = *it;
407
407
if (MI->getParent () != MBB)
408
408
continue ;
409
409
@@ -412,7 +412,7 @@ void StackColoring::calculateLiveIntervals(unsigned NumSlots) {
412
412
" Invalid Lifetime marker" );
413
413
414
414
bool IsStart = MI->getOpcode () == TargetOpcode::LIFETIME_START;
415
- MachineOperand &Mo = MI->getOperand (0 );
415
+ const MachineOperand &Mo = MI->getOperand (0 );
416
416
int Slot = Mo.getIndex ();
417
417
assert (Slot >= 0 && " Invalid slot" );
418
418
@@ -499,7 +499,7 @@ void StackColoring::remapInstructions(DenseMap<int, int> &SlotRemap) {
499
499
500
500
// Keep a list of *allocas* which need to be remapped.
501
501
DenseMap<const AllocaInst*, const AllocaInst*> Allocas;
502
- for (DenseMap<int , int >::iterator it = SlotRemap.begin (),
502
+ for (DenseMap<int , int >::const_iterator it = SlotRemap.begin (),
503
503
e = SlotRemap.end (); it != e; ++it) {
504
504
const AllocaInst *From = MFI->getObjectAllocation (it->first );
505
505
const AllocaInst *To = MFI->getObjectAllocation (it->second );
@@ -594,8 +594,8 @@ void StackColoring::remapInstructions(DenseMap<int, int> &SlotRemap) {
594
594
}
595
595
596
596
void StackColoring::removeInvalidSlotRanges () {
597
- MachineFunction::iterator BB, BBE;
598
- MachineBasicBlock::iterator I, IE;
597
+ MachineFunction::const_iterator BB, BBE;
598
+ MachineBasicBlock::const_iterator I, IE;
599
599
for (BB = MF->begin (), BBE = MF->end (); BB != BBE; ++BB)
600
600
for (I = BB->begin (), IE = BB->end (); I != IE; ++I) {
601
601
@@ -614,7 +614,7 @@ void StackColoring::removeInvalidSlotRanges() {
614
614
615
615
// Check all of the machine operands.
616
616
for (unsigned i = 0 ; i < I->getNumOperands (); ++i) {
617
- MachineOperand &MO = I->getOperand (i);
617
+ const MachineOperand &MO = I->getOperand (i);
618
618
619
619
if (!MO.isFI ())
620
620
continue ;
0 commit comments