[llvm] 3b73293 - Fix type mismatch in ARM calling convention ternary (#180872)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 16 10:37:39 PST 2026
Author: Eric Christopher
Date: 2026-02-16T10:37:35-08:00
New Revision: 3b732934c6e038fff061d8c4a7a5fdfe716a602e
URL: https://github.com/llvm/llvm-project/commit/3b732934c6e038fff061d8c4a7a5fdfe716a602e
DIFF: https://github.com/llvm/llvm-project/commit/3b732934c6e038fff061d8c4a7a5fdfe716a602e.diff
LOG: Fix type mismatch in ARM calling convention ternary (#180872)
GCC's -Wextra flags the ternary in the ARM half-precision calling
convention setup because the branches have different types. Use
static_cast to make both sides consistent.
Built with ToT clang and GCC 13.3.0 on Linux x86_64. All existing tests
pass.
Added:
Modified:
llvm/include/llvm/IR/RuntimeLibcalls.td
Removed:
################################################################################
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