[lld] r248580 - COFF: Fix local varaible type.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 11:27:47 PDT 2015


On Fri, Sep 25, 2015 at 9:38 AM, Rui Ueyama via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: ruiu
> Date: Fri Sep 25 11:38:13 2015
> New Revision: 248580
>
> URL: http://llvm.org/viewvc/llvm-project?rev=248580&view=rev
> Log:
> COFF: Fix local varaible type.
>
> This is intended to be 64-bit integer, but size_t is not guranteed
> to be the same or larger type than uint64_t.
>
> Modified:
>     lld/trunk/COFF/ICF.cpp
>
> Modified: lld/trunk/COFF/ICF.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/ICF.cpp?rev=248580&r1=248579&r2=248580&view=diff
>
> ==============================================================================
> --- lld/trunk/COFF/ICF.cpp (original)
> +++ lld/trunk/COFF/ICF.cpp Fri Sep 25 11:38:13 2015
> @@ -156,7 +156,7 @@ bool ICF::partition(ChunkIterator Begin,
>      });
>      if (Bound == End)
>        return R;
> -    size_t ID = NextID++;
> +    uint64_t ID = NextID++;


Not sure if it's better: but you could just use auto to make sure it's the
same type as NextID?


>      std::for_each(It, Bound, [&](SectionChunk *SC) { SC->GroupID = ID; });
>      It = Bound;
>      R = true;
>
>
> _______________________________________________
> 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/20150925/04243749/attachment.html>


More information about the llvm-commits mailing list