]> granicus.if.org Git - llvm/commitdiff
Push a dependent computation into the assert that uses it; NFC
authorSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 15 Jun 2016 07:27:04 +0000 (07:27 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 15 Jun 2016 07:27:04 +0000 (07:27 +0000)
... instead of explicitly conditioning on NDEBUG.  Also use an easier to
read conditional expression.

(Addresses post-commit review from David Blaikie.)

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

lib/Target/X86/X86FrameLowering.cpp

index 043e833bc78caebfb67b03d1155ad6917ddd079d..2be00ca17079deac71381f6fe94218da03c9b748 100644 (file)
@@ -1773,12 +1773,10 @@ X86FrameLowering::getFrameIndexReferenceFromSP(const MachineFunction &MF,
   const TargetFrameLowering *TFI = MF.getSubtarget().getFrameLowering();
   if (!AllowSPAdjustment && !TFI->hasReservedCallFrame(MF))
     return None;
-#ifndef NDEBUG
+
   // We don't handle tail calls, and shouldn't be seeing them either.
-  int TailCallReturnAddrDelta =
-      MF.getInfo<X86MachineFunctionInfo>()->getTCReturnAddrDelta();
-  assert(!(TailCallReturnAddrDelta < 0) && "we don't handle this case!");
-#endif
+  assert(MF.getInfo<X86MachineFunctionInfo>()->getTCReturnAddrDelta() >= 0 &&
+         "we don't handle this case!");
 
   // Fill in FrameReg output argument.
   FrameReg = TRI->getStackRegister();