[llvm] r307138 - [globalisel][tablegen] Fix an unused variable warning in release builds after r307133

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 11:43:57 PDT 2017


The usual way to deal with unused values (when they're only used in an
assert) in LLVM is with a (void)X; statement near the assertion - so it's
easier to track them together.

Alternatively, is there a reason the assertion couldn't move up two lines,
before the increments as needed? (or does the increment cause a mutation of
OutMIs.size in some indirect way?)

On Wed, Jul 5, 2017 at 8:37 AM Daniel Sanders via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: dsanders
> Date: Wed Jul  5 03:16:48 2017
> New Revision: 307138
>
> URL: http://llvm.org/viewvc/llvm-project?rev=307138&view=rev
> Log:
> [globalisel][tablegen] Fix an unused variable warning in release builds
> after r307133
>
>
> Modified:
>     llvm/trunk/lib/CodeGen/GlobalISel/InstructionSelector.cpp
>
> Modified: llvm/trunk/lib/CodeGen/GlobalISel/InstructionSelector.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/InstructionSelector.cpp?rev=307138&r1=307137&r2=307138&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/GlobalISel/InstructionSelector.cpp (original)
> +++ llvm/trunk/lib/CodeGen/GlobalISel/InstructionSelector.cpp Wed Jul  5
> 03:16:48 2017
> @@ -59,7 +59,7 @@ void InstructionSelector::executeEmitTab
>        break;
>      }
>      case GIR_BuildMI: {
> -      int64_t InsnID = *Command++;
> +      int64_t InsnID LLVM_ATTRIBUTE_UNUSED = *Command++;
>        int64_t Opcode = *Command++;
>        assert((size_t)InsnID == OutMIs.size() &&
>               "Expected to store MIs in order");
>
>
> _______________________________________________
> 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/20170710/6b7caf36/attachment.html>


More information about the llvm-commits mailing list