[llvm] r272760 - Fix unused variable warning; NFC

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 00:20:00 PDT 2016


usually we just use "(void)var;" or roll the expression into the assert -
any reason not to do one of those things here?

(also that condition "!(x < 0)" seems like it might be easier to read as "x
>= 0")

On Tue, Jun 14, 2016 at 11:53 PM, Sanjoy Das via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: sanjoy
> Date: Wed Jun 15 01:53:59 2016
> New Revision: 272760
>
> URL: http://llvm.org/viewvc/llvm-project?rev=272760&view=rev
> Log:
> Fix unused variable warning; NFC
>
> TailCallReturnAddrDelta is used only in an assert, so put it under
> defined(NDEBUG).
>
> 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=272760&r1=272759&r2=272760&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86FrameLowering.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86FrameLowering.cpp Wed Jun 15 01:53:59 2016
> @@ -1773,10 +1773,12 @@ 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
>
>    // Fill in FrameReg output argument.
>    FrameReg = TRI->getStackRegister();
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160615/d2c92397/attachment.html>


More information about the llvm-commits mailing list