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

via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 15 16:34:05 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: Eric Christopher (echristo)

<details>
<summary>Changes</summary>

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.

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


1 Files Affected:

- (modified) llvm/include/llvm/IR/RuntimeLibcalls.td (+2-2) 


``````````diff
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 :

``````````

</details>


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


More information about the llvm-commits mailing list