@@ -413,29 +413,32 @@ class LiveIntervals {
413413 // / Return the live range for register unit \p Unit. It will be computed if
414414 // / it doesn't exist.
415415 LiveRange &getRegUnit (MCRegUnit Unit) {
416- LiveRange *LR = RegUnitRanges[Unit];
416+ LiveRange *LR = RegUnitRanges[static_cast < unsigned >( Unit) ];
417417 if (!LR) {
418418 // Compute missing ranges on demand.
419419 // Use segment set to speed-up initial computation of the live range.
420- RegUnitRanges[Unit] = LR = new LiveRange (UseSegmentSetForPhysRegs);
420+ RegUnitRanges[static_cast <unsigned >(Unit)] = LR =
421+ new LiveRange (UseSegmentSetForPhysRegs);
421422 computeRegUnitRange (*LR, Unit);
422423 }
423424 return *LR;
424425 }
425426
426427 // / Return the live range for register unit \p Unit if it has already been
427428 // / computed, or nullptr if it hasn't been computed yet.
428- LiveRange *getCachedRegUnit (MCRegUnit Unit) { return RegUnitRanges[Unit]; }
429+ LiveRange *getCachedRegUnit (MCRegUnit Unit) {
430+ return RegUnitRanges[static_cast <unsigned >(Unit)];
431+ }
429432
430433 const LiveRange *getCachedRegUnit (MCRegUnit Unit) const {
431- return RegUnitRanges[Unit];
434+ return RegUnitRanges[static_cast < unsigned >( Unit) ];
432435 }
433436
434437 // / Remove computed live range for register unit \p Unit. Subsequent uses
435438 // / should rely on on-demand recomputation.
436439 void removeRegUnit (MCRegUnit Unit) {
437- delete RegUnitRanges[Unit];
438- RegUnitRanges[Unit] = nullptr ;
440+ delete RegUnitRanges[static_cast < unsigned >( Unit) ];
441+ RegUnitRanges[static_cast < unsigned >( Unit) ] = nullptr ;
439442 }
440443
441444 // / Remove associated live ranges for the register units associated with \p
0 commit comments