[llvm] r272762 - Push a dependent computation into the assert that uses it; NFC

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 00:27:04 PDT 2016


Author: sanjoy
Date: Wed Jun 15 02:27:04 2016
New Revision: 272762

URL: http://llvm.org/viewvc/llvm-project?rev=272762&view=rev
Log:
Push a dependent computation into the assert that uses it; NFC

... instead of explicitly conditioning on NDEBUG.  Also use an easier to
read conditional expression.

(Addresses post-commit review from David Blaikie.)

Modified:
    llvm/trunk/lib/Target/X86/X86FrameLowering.cpp

Modified: llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FrameLowering.cpp?rev=272762&r1=272761&r2=272762&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FrameLowering.cpp Wed Jun 15 02:27:04 2016
@@ -1773,12 +1773,10 @@ X86FrameLowering::getFrameIndexReference
   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();




More information about the llvm-commits mailing list