[llvm] [ARM] Silence -Wunused-variable in -asserts build, fix for d130f402642fba (PR #164869)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 23 11:28:08 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-arm

Author: Reid Kleckner (rnk)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/164869.diff


1 Files Affected:

- (modified) llvm/lib/Target/ARM/ARMAsmPrinter.cpp (+1-2) 


``````````diff
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
index 8e35cadb75857..36b99087e0a32 100644
--- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -1640,8 +1640,7 @@ void ARMAsmPrinter::EmitKCFI_CHECK_Thumb2(Register AddrReg, int64_t Type,
     bool isLast = (i == 3);
 
     // Verify the immediate can be encoded as Thumb2 modified immediate.
-    int T2SOImmVal = ARM_AM::getT2SOImmVal(imm);
-    assert(T2SOImmVal != -1 &&
+    assert(ARM_AM::getT2SOImmVal(imm) != -1 &&
            "Cannot encode immediate as Thumb2 modified immediate");
 
     // eor[s] scratch, scratch, #imm (last one sets flags with CPSR)

``````````

</details>


https://github.com/llvm/llvm-project/pull/164869


More information about the llvm-commits mailing list