@@ -914,10 +914,10 @@ void StackColoring::remapInstructions(DenseMap<int, int> &SlotRemap) {
914
914
if (!VI.Var || !VI.inStackSlot ())
915
915
continue ;
916
916
int Slot = VI.getStackSlot ();
917
- if (SlotRemap.count (Slot)) {
917
+ if (auto It = SlotRemap.find (Slot); It != SlotRemap. end ( )) {
918
918
LLVM_DEBUG (dbgs () << " Remapping debug info for ["
919
919
<< cast<DILocalVariable>(VI.Var )->getName () << " ].\n " );
920
- VI.updateStackSlot (SlotRemap[Slot] );
920
+ VI.updateStackSlot (It-> second );
921
921
FixedDbg++;
922
922
}
923
923
}
@@ -1004,10 +1004,11 @@ void StackColoring::remapInstructions(DenseMap<int, int> &SlotRemap) {
1004
1004
if (!AI)
1005
1005
continue ;
1006
1006
1007
- if (!Allocas.count (AI))
1007
+ auto It = Allocas.find (AI);
1008
+ if (It == Allocas.end ())
1008
1009
continue ;
1009
1010
1010
- MMO->setValue (Allocas[AI] );
1011
+ MMO->setValue (It-> second );
1011
1012
FixedMemOp++;
1012
1013
}
1013
1014
@@ -1173,8 +1174,8 @@ void StackColoring::expungeSlotMap(DenseMap<int, int> &SlotRemap,
1173
1174
// Expunge slot remap map.
1174
1175
for (unsigned i=0 ; i < NumSlots; ++i) {
1175
1176
// If we are remapping i
1176
- if (SlotRemap.count (i )) {
1177
- int Target = SlotRemap[i] ;
1177
+ if (auto It = SlotRemap.find (i); It != SlotRemap. end ( )) {
1178
+ int Target = It-> second ;
1178
1179
// As long as our target is mapped to something else, follow it.
1179
1180
while (SlotRemap.count (Target)) {
1180
1181
Target = SlotRemap[Target];
0 commit comments