OSDN Git Service

[ARM] Fix for NDEBUG builds
authorSam Parker <sam.parker@arm.com>
Wed, 3 Jul 2019 14:39:23 +0000 (14:39 +0000)
committerSam Parker <sam.parker@arm.com>
Wed, 3 Jul 2019 14:39:23 +0000 (14:39 +0000)
Fix unused variable warning as well as a nonsense assert.

Differential Revision: https://reviews.llvm.org/D63816

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365046 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMISelLowering.cpp

index c1668dc..28d014c 100644 (file)
@@ -12964,10 +12964,9 @@ static SDValue PerformHWLoopCombine(SDNode *N,
   if (IntOp != Intrinsic::test_set_loop_iterations)
     return SDValue();
 
-  if (auto *Const = dyn_cast<ConstantSDNode>(CC->getOperand(1)))
-    assert(Const->isOne() && "Expected to compare against 1");
-  else
-    assert(Const->isOne() && "Expected to compare against 1");
+  assert((isa<ConstantSDNode>(CC->getOperand(1)) &&
+          cast<ConstantSDNode>(CC->getOperand(1))->isOne()) &&
+          "Expected to compare against 1");
 
   SDLoc dl(Int);
   SDValue Chain = N->getOperand(0);