[PATCH] D28695: "Use" lambda captures which are otherwise only used in asserts. NFC
David L. Jones via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 13 13:11:12 PST 2017
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));
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28695.84359.patch
Type: text/x-patch
Size: 1684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170113/ad71b441/attachment.bin>
More information about the llvm-commits
mailing list