[llvm] r334731 - Avoid unused variable in non-assert builds.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 18 11:53:46 PDT 2018


Could the getSDValue call be rolled into the assert? (to avoid doing the
work of that function call when assertions are enabled) Or does it have
necessary side effects that must occur even in a nonasserts build?
(functions name 'get' with side effects are a bit misleading, though not
all that uncommon)

On Thu, Jun 14, 2018 at 8:59 AM Nirav Dave via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: niravd
> Date: Thu Jun 14 08:55:15 2018
> New Revision: 334731
>
> URL: http://llvm.org/viewvc/llvm-project?rev=334731&view=rev
> Log:
> Avoid unused variable in non-assert builds.
>
> Modified:
>     llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=334731&r1=334730&r2=334731&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Thu Jun 14
> 08:55:15 2018
> @@ -105,6 +105,7 @@ void DAGTypeLegalizer::PerformExpensiveC
>            I = ReplacedValues.find(NewValId);
>          }
>          SDValue NewVal = getSDValue(NewValId);
> +        (void)NewVal;
>          assert(NewVal.getNode()->getNodeId() != NewNode &&
>                 "ReplacedValues maps to a new node!");
>        }
>
>
> _______________________________________________
> 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/20180618/ba27495a/attachment.html>


More information about the llvm-commits mailing list