[llvm] b68bae6 - [AArch64] Fix -Wunused-but-set-variable in GCC non-debug build

Simon Wallis via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 11 09:54:56 PST 2021


Author: Simon Wallis
Date: 2021-03-11T17:54:05Z
New Revision: b68bae6a94fb5b5251cf6b08eb81799ea99ea0df

URL: https://github.com/llvm/llvm-project/commit/b68bae6a94fb5b5251cf6b08eb81799ea99ea0df
DIFF: https://github.com/llvm/llvm-project/commit/b68bae6a94fb5b5251cf6b08eb81799ea99ea0df.diff

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

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

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D98431

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp b/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
index 7329c6370af0..3b099d0b91bf 100644
--- a/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
+++ b/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
@@ -884,8 +884,8 @@ static bool selectCopy(MachineInstr &I, const TargetInstrInfo &TII,
 #ifndef NDEBUG
     ValidCopy = KnownValid || isValidCopy(I, DstRegBank, MRI, TRI, RBI);
     assert(ValidCopy && "Invalid copy.");
-    (void)KnownValid;
 #endif
+    (void)KnownValid;
     return ValidCopy;
   };
 


        


More information about the llvm-commits mailing list