Perturb code in an attempt to appease MSVC
authorSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 2 Mar 2016 02:34:20 +0000 (02:34 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 2 Mar 2016 02:34:20 +0000 (02:34 +0000)
For some reason MSVC seems to think I'm calling getConstant() from a
static context.  Try to avoid this issue by explicitly specifying
'this->' (though I'm not confident that this will actually work).

llvm-svn: 262451

llvm/lib/Analysis/ScalarEvolution.cpp

index 5f8db62..d5e97a3 100644 (file)
@@ -4577,15 +4577,15 @@ ConstantRange ScalarEvolution::getRangeViaFactoring(const SCEV *Start,
   // from deep in the call stack, and calling getSCEV (on a sext instruction,
   // say) can end up caching a suboptimal value.
 
-  APInt TrueStart = *StartPattern.TrueValue + Offset;
-  APInt TrueStep = *StepPattern.TrueValue;
-  APInt FalseStart = *StartPattern.FalseValue + Offset;
-  APInt FalseStep = *StepPattern.FalseValue;
-
-  ConstantRange TrueRange = getRangeForAffineAR(
-      getConstant(TrueStart), getConstant(TrueStep), MaxBECount, BitWidth);
-  ConstantRange FalseRange = getRangeForAffineAR(
-      getConstant(FalseStart), getConstant(FalseStep), MaxBECount, BitWidth);
+  const SCEV *TrueStart = this->getConstant(*StartPattern.TrueValue + Offset);
+  const SCEV *TrueStep = this->getConstant(*StepPattern.TrueValue);
+  const SCEV *FalseStart = this->getConstant(*StartPattern.FalseValue + Offset);
+  const SCEV *FalseStep = this->getConstant(*StepPattern.FalseValue);
+
+  ConstantRange TrueRange =
+      getRangeForAffineAR(TrueStart, TrueStep, MaxBECount, BitWidth);
+  ConstantRange FalseRange =
+      getRangeForAffineAR(FalseStart, FalseStep, MaxBECount, BitWidth);
 
   return TrueRange.unionWith(FalseRange);
 }