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

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 23 11:27:22 PDT 2025


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

None

>From 991bc941829b5b296e7623d78c355ada85d88dd2 Mon Sep 17 00:00:00 2001
From: Reid Kleckner <rnk at google.com>
Date: Thu, 23 Oct 2025 18:26:50 +0000
Subject: [PATCH] [ARM] Silence -Wunused-variable in -asserts build, fix for
 d130f402642fba

---
 llvm/lib/Target/ARM/ARMAsmPrinter.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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)



More information about the llvm-commits mailing list