[llvm] r305485 - Silence warning with assertions disabled.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 19 09:33:56 PDT 2017


probably easier/-better to fold the Res.end() call into the assert? It's an
ArrayRef so computing the end iterator isn't expensive in any way.

On Thu, Jun 15, 2017 at 10:42 AM Peter Collingbourne via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: pcc
> Date: Thu Jun 15 12:41:32 2017
> New Revision: 305485
>
> URL: http://llvm.org/viewvc/llvm-project?rev=305485&view=rev
> Log:
> Silence warning with assertions disabled.
>
> Modified:
>     llvm/trunk/lib/LTO/LTO.cpp
>
> Modified: llvm/trunk/lib/LTO/LTO.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTO.cpp?rev=305485&r1=305484&r2=305485&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/LTO/LTO.cpp (original)
> +++ llvm/trunk/lib/LTO/LTO.cpp Thu Jun 15 12:41:32 2017
> @@ -371,6 +371,7 @@ void LTO::addModuleToGlobalRes(ArrayRef<
>                                 unsigned Partition, bool InSummary) {
>    auto *ResI = Res.begin();
>    auto *ResE = Res.end();
> +  (void)ResE;
>    for (const InputFile::Symbol &Sym : Syms) {
>      assert(ResI != ResE);
>      SymbolResolution Res = *ResI++;
>
>
> _______________________________________________
> 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/20170619/0a6782c9/attachment.html>


More information about the llvm-commits mailing list