File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -77,17 +77,17 @@ void DemandedBits::determineLiveOperandBits(
7777 }
7878 };
7979 auto GetShiftedRange = [&](unsigned Min, unsigned Max, bool ShiftLeft) {
80- using ShiftFn = APInt ( APInt::*)( unsigned ) const ;
81- auto Shift = ShiftLeft ? static_cast <ShiftFn>(&APInt::shl)
82- : static_cast <ShiftFn>(&APInt::lshr) ;
80+ auto ShiftF = [&]( const APInt &Mask, unsigned ShiftAmnt) {
81+ return ShiftLeft ? Mask. shl (ShiftAmnt) : Mask. lshr (ShiftAmnt);
82+ } ;
8383 AB = APInt::getZero (BitWidth);
8484 uint8_t LoopRange = Max - Min;
8585 auto Mask = AOut;
8686 for (unsigned ShiftAmnt = 1 ; ShiftAmnt <= LoopRange; ShiftAmnt <<= 1 ) {
87- APInt Shifted = (Mask.*Shift)( ShiftAmnt);
87+ APInt Shifted = ShiftF (Mask, ShiftAmnt);
8888 Mask |= Shifted;
8989 }
90- AB = (Mask.*Shift)( Min);
90+ AB = ShiftF (Mask, Min);
9191 };
9292
9393 switch (UserI->getOpcode ()) {
You can’t perform that action at this time.
0 commit comments