[clang] [clang][HIP] Normalize __cdecl on abstract function types to the device default CC on amdgcnspirv (PR #210882)

Arseniy Obolenskiy via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 9 21:27:41 PDT 2026


================
@@ -59,7 +59,12 @@ using namespace CodeGen;
 
 unsigned CodeGenTypes::ClangCallConvToLLVMCallConv(CallingConv CC) {
   switch (CC) {
-  default:
+  case CC_C:
+    // On SPIR/SPIR-V, CC_C is the AST-level default calling convention, but
+    // it still needs to lower to spir_func so IR consumers can rely on the
+    // calling convention to distinguish device functions.
+    if (Target.getTriple().isSPIROrSPIRV())
+      return llvm::CallingConv::SPIR_FUNC;
----------------
aobolensk wrote:

Addressed there

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


More information about the cfe-commits mailing list