[llvm] Fix type mismatch in ARM calling convention ternary (PR #180872)

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 14 10:50:22 PST 2026


https://github.com/echristo updated https://github.com/llvm/llvm-project/pull/180872

>From 0be3a95e07b45616906e5a84e6795ecb5b82eb97 Mon Sep 17 00:00:00 2001
From: Eric Christopher <echristo at gmail.com>
Date: Sat, 14 Feb 2026 10:49:41 -0800
Subject: [PATCH] Fix type mismatch in ARM calling convention ternary

GCC's -Wextra flags the ternary here because the branches have
different types. Use static_cast to make both sides consistent.
---
 llvm/include/llvm/IR/RuntimeLibcalls.td | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td
index cc7138850e0b3..78d71a54e8591 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -2474,8 +2474,8 @@ def __gnu_h2f_ieee : RuntimeLibcallImpl<FPEXT_F16_F32>;
 // non-watchos platforms, but are needed for some targets which use a
 // hard-float calling convention by default.
 def ARMHalfConvertLibcallCallingConv : LibcallCallingConv<
-  [{TT.isWatchABI() ? DefaultCC :
-    (isAAPCS_ABI(TT, ABIName) ? CallingConv::ARM_AAPCS : CallingConv::ARM_APCS)}]
+  [{TT.isWatchABI() ? static_cast<CallingConv::ID>(DefaultCC) :
+    static_cast<CallingConv::ID>(isAAPCS_ABI(TT, ABIName) ? CallingConv::ARM_AAPCS : CallingConv::ARM_APCS)}]
 >;
 
 def ARMLibgccHalfConvertCalls :



More information about the llvm-commits mailing list