[llvm] Fix type mismatch in ARM calling convention ternary (PR #180872)
Eric Christopher via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 10 17:55:57 PST 2026
https://github.com/echristo created https://github.com/llvm/llvm-project/pull/180872
### Summary
Fix type mismatch in ternary that causes GCC `-Werror=extra` to fail.
#### Details
GCC's `-Werror=extra` enforces stricter type consistency in ternary expressions, in this case const-qualified enum variable with enum literals.
### Tested
- Built with ToT clang and GCC 13.3.0 on Linux x86_64 (not really because there are other warnings, but this one is gone).
- All existing tests pass
>From 69d5f0df21140ea5ff21d251707b2122094dd706 Mon Sep 17 00:00:00 2001
From: Eric Christopher <echristo at gmail.com>
Date: Fri, 6 Feb 2026 00:43:57 -0800
Subject: [PATCH] ### Summary
Fix type mismatch in ternary that causes GCC `-Werror=extra` to fail.
#### Details
GCC's `-Werror=extra` enforces stricter type consistency in ternary expressions, in this case const-qualified enum variable
with enum literals.
### Tested
- Built with ToT clang and GCC 13.3.0 on Linux x86_64 (not really because there are other warnings, but this one is gone).
- All existing tests pass
---
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..a8ef8495a1d6b 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() ? (CallingConv::ID)DefaultCC :
+ (CallingConv::ID)(isAAPCS_ABI(TT, ABIName) ? CallingConv::ARM_AAPCS : CallingConv::ARM_APCS)}]
>;
def ARMLibgccHalfConvertCalls :
More information about the llvm-commits
mailing list