[PATCH] D28695: "Use" lambda captures which are otherwise only used in asserts. NFC

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 16 10:33:21 PST 2017


Looks like this was signed off on Phab but no email ever made it to the
mailing list (making this look like code was sent for review, but committed
without review being completed).

Richard - looks like Phab doesn't send email unless there's some comment in
the approval action. So you can put some comment there, like "LGTM" to make
sure the approval is reflected on the mailing list.

On Fri, Jan 13, 2017 at 1:11 PM David L. Jones via Phabricator via
llvm-commits <llvm-commits at lists.llvm.org> wrote:

> dlj created this revision.
> dlj added a reviewer: rsmith.
> dlj added a subscriber: llvm-commits.
>
> The LLVM coding standards recommend "using" values that are only
> needed by asserts:
> http://llvm.org/docs/CodingStandards.html#assert-liberally
>
> Without this change, LLVM cannot bootstrap with -Werror as the second
> stage fails with this new warning:
> https://reviews.llvm.org/rL291905
>
> See also the previous fixes:
> https://reviews.llvm.org/rL291916
> https://reviews.llvm.org/rL291939
> https://reviews.llvm.org/rL291940
> https://reviews.llvm.org/rL291941
>
>
> https://reviews.llvm.org/D28695
>
> Files:
>   lib/Target/Hexagon/HexagonBitSimplify.cpp
>   lib/Transforms/Scalar/SROA.cpp
>   lib/Transforms/Utils/ValueMapper.cpp
>
>
> Index: lib/Transforms/Utils/ValueMapper.cpp
> ===================================================================
> --- lib/Transforms/Utils/ValueMapper.cpp
> +++ lib/Transforms/Utils/ValueMapper.cpp
> @@ -681,6 +681,7 @@
>      remapOperands(*ClonedN, [this, &D, &G](Metadata *Old) {
>        if (Optional<Metadata *> MappedOp = getMappedOp(Old))
>          return *MappedOp;
> +      (void)D;
>        assert(G.Info[Old].ID > D.ID && "Expected a forward reference");
>        return &G.getFwdReference(*cast<MDNode>(Old));
>      });
> Index: lib/Transforms/Scalar/SROA.cpp
> ===================================================================
> --- lib/Transforms/Scalar/SROA.cpp
> +++ lib/Transforms/Scalar/SROA.cpp
> @@ -1825,6 +1825,7 @@
>      // Rank the remaining candidate vector types. This is easy because we
> know
>      // they're all integer vectors. We sort by ascending number of
> elements.
>      auto RankVectorTypes = [&DL](VectorType *RHSTy, VectorType *LHSTy) {
> +      (void)DL;
>        assert(DL.getTypeSizeInBits(RHSTy) == DL.getTypeSizeInBits(LHSTy) &&
>               "Cannot have vector types of different sizes!");
>        assert(RHSTy->getElementType()->isIntegerTy() &&
> Index: lib/Target/Hexagon/HexagonBitSimplify.cpp
> ===================================================================
> --- lib/Target/Hexagon/HexagonBitSimplify.cpp
> +++ lib/Target/Hexagon/HexagonBitSimplify.cpp
> @@ -896,6 +896,7 @@
>                    *MRI.getTargetRegisterInfo());
>
>    auto VerifySR = [&HRI] (const TargetRegisterClass *RC, unsigned Sub) ->
> void {
> +    (void)HRI;
>      assert(Sub == HRI.getHexagonSubRegIndex(RC, Hexagon::ps_sub_lo) ||
>             Sub == HRI.getHexagonSubRegIndex(RC, Hexagon::ps_sub_hi));
>    };
>
>
> _______________________________________________
> 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/20170116/c6e73b2e/attachment.html>


More information about the llvm-commits mailing list