[PATCH] D98431: [AArch64] Fix -Wunused-but-set-variable in GCC non-debug build

Simon Wallis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 11 08:43:57 PST 2021


simonwallis2 created this revision.
simonwallis2 added a reviewer: MaskRay.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls.
simonwallis2 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

[AArch64] Fix -Wunused-but-set-variable in GCC -DLLVM_ENABLE_ASSERTIONS=off non-debug build.


https://reviews.llvm.org/D98431

Files:
  llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp


Index: llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
===================================================================
--- llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
+++ llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
@@ -884,8 +884,8 @@
 #ifndef NDEBUG
     ValidCopy = KnownValid || isValidCopy(I, DstRegBank, MRI, TRI, RBI);
     assert(ValidCopy && "Invalid copy.");
-    (void)KnownValid;
 #endif
+    (void)KnownValid;
     return ValidCopy;
   };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98431.329977.patch
Type: text/x-patch
Size: 504 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210311/cb3197d8/attachment.bin>


More information about the llvm-commits mailing list