https://github.com/aobolensk updated 
https://github.com/llvm/llvm-project/pull/216252

>From f07d9c40a6eb18e0b8f42bdc8d21169096b72a19 Mon Sep 17 00:00:00 2001
From: Arseniy Obolenskiy <[email protected]>
Date: Fri, 14 Aug 2026 07:46:51 +0200
Subject: [PATCH 1/2] [clang][SPIR-V] Remove CC_SpirFunction calling convention

CC_SpirFunction is now redundant: CC_C already lowers to spir_func on 
SPIR/SPIR-V targets, after https://github.com/llvm/llvm-project/pull/210882

this also invalidates the previous CC_SpirFunction debuginfo test: 
https://github.com/llvm/llvm-project/pull/216095
---
 clang/include/clang/Basic/Specifiers.h | 2 --
 clang/lib/AST/ItaniumMangle.cpp        | 1 -
 clang/lib/AST/Type.cpp                 | 2 --
 clang/lib/AST/TypePrinter.cpp          | 3 ---
 clang/lib/Basic/Targets/SPIR.h         | 4 +---
 clang/lib/CodeGen/CGCall.cpp           | 2 --
 clang/lib/CodeGen/CGDebugInfo.cpp      | 2 --
 clang/lib/CodeGen/Targets/SPIR.cpp     | 2 +-
 clang/test/DebugInfo/Generic/cc.c      | 1 -
 clang/tools/libclang/CXType.cpp        | 1 -
 10 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/clang/include/clang/Basic/Specifiers.h 
b/clang/include/clang/Basic/Specifiers.h
index 81b228f5054f8..a35f1cfd5f9d6 100644
--- a/clang/include/clang/Basic/Specifiers.h
+++ b/clang/include/clang/Basic/Specifiers.h
@@ -289,7 +289,6 @@ namespace clang {
     CC_AAPCS,             // __attribute__((pcs("aapcs")))
     CC_AAPCS_VFP,         // __attribute__((pcs("aapcs-vfp")))
     CC_IntelOclBicc,      // __attribute__((intel_ocl_bicc))
-    CC_SpirFunction,      // not assigned at the AST level, codegen-only on 
SPIR
     CC_DeviceKernel,      // __attribute__((device_kernel))
     CC_Swift,             // __attribute__((swiftcall))
     CC_SwiftAsync,        // __attribute__((swiftasynccall))
@@ -325,7 +324,6 @@ namespace clang {
     case CC_X86RegCall:
     case CC_X86Pascal:
     case CC_X86VectorCall:
-    case CC_SpirFunction:
     case CC_DeviceKernel:
     case CC_Swift:
     case CC_SwiftAsync:
diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp
index f6c4ca1ae6ba8..da8339e4a45ee 100644
--- a/clang/lib/AST/ItaniumMangle.cpp
+++ b/clang/lib/AST/ItaniumMangle.cpp
@@ -3546,7 +3546,6 @@ StringRef 
CXXNameMangler::getCallingConvQualifierName(CallingConv CC) {
   case CC_AArch64VectorCall:
   case CC_AArch64SVEPCS:
   case CC_IntelOclBicc:
-  case CC_SpirFunction:
   case CC_DeviceKernel:
   case CC_PreserveMost:
   case CC_PreserveAll:
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 5069b587c1f8b..4063d03f7750e 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -3765,8 +3765,6 @@ StringRef FunctionType::getNameForCallConv(CallingConv 
CC) {
     return "aarch64_sve_pcs";
   case CC_IntelOclBicc:
     return "intel_ocl_bicc";
-  case CC_SpirFunction:
-    return "spir_function";
   case CC_DeviceKernel:
     return "device_kernel";
   case CC_Swift:
diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp
index 20dd450d5d63f..bb3aa2bd22e77 100644
--- a/clang/lib/AST/TypePrinter.cpp
+++ b/clang/lib/AST/TypePrinter.cpp
@@ -1181,9 +1181,6 @@ void TypePrinter::printFunctionAfter(const 
FunctionType::ExtInfo &Info,
     case CC_X86RegCall:
       OS << " __attribute__((regcall))";
       break;
-    case CC_SpirFunction:
-      // Do nothing. These CCs are not available as attributes.
-      break;
     case CC_Swift:
       OS << " __attribute__((swiftcall))";
       break;
diff --git a/clang/lib/Basic/Targets/SPIR.h b/clang/lib/Basic/Targets/SPIR.h
index 00d766ffea113..48a3d9e481f0e 100644
--- a/clang/lib/Basic/Targets/SPIR.h
+++ b/clang/lib/Basic/Targets/SPIR.h
@@ -183,9 +183,7 @@ class LLVM_LIBRARY_VISIBILITY BaseSPIRTargetInfo : public 
TargetInfo {
   }
 
   CallingConvCheckResult checkCallingConvention(CallingConv CC) const override 
{
-    return (CC == CC_C || CC == CC_SpirFunction || CC == CC_DeviceKernel)
-               ? CCCR_OK
-               : CCCR_Warning;
+    return (CC == CC_C || CC == CC_DeviceKernel) ? CCCR_OK : CCCR_Warning;
   }
 
   void setAddressSpaceMap(bool DefaultIsGeneric) {
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index d0e0a55e78ced..0894bda19a4b3 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -94,8 +94,6 @@ unsigned 
CodeGenTypes::ClangCallConvToLLVMCallConv(CallingConv CC) {
     return llvm::CallingConv::AArch64_VectorCall;
   case CC_AArch64SVEPCS:
     return llvm::CallingConv::AArch64_SVE_VectorCall;
-  case CC_SpirFunction:
-    return llvm::CallingConv::SPIR_FUNC;
   case CC_DeviceKernel:
     return CGM.getTargetCodeGenInfo().getDeviceKernelCallingConv();
   case CC_PreserveMost:
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp 
b/clang/lib/CodeGen/CGDebugInfo.cpp
index 27db6a3110695..37ee3765fd7c4 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1825,8 +1825,6 @@ static unsigned getDwarfCC(CallingConv CC, const 
llvm::Triple &T) {
     return llvm::dwarf::DW_CC_LLVM_AAPCS_VFP;
   case CC_IntelOclBicc:
     return llvm::dwarf::DW_CC_LLVM_IntelOclBicc;
-  case CC_SpirFunction:
-    return llvm::dwarf::DW_CC_LLVM_SpirFunction;
   case CC_DeviceKernel:
     return llvm::dwarf::DW_CC_LLVM_DeviceKernel;
   case CC_Swift:
diff --git a/clang/lib/CodeGen/Targets/SPIR.cpp 
b/clang/lib/CodeGen/Targets/SPIR.cpp
index 177d166d5b85b..3cb0a10f9a4fd 100644
--- a/clang/lib/CodeGen/Targets/SPIR.cpp
+++ b/clang/lib/CodeGen/Targets/SPIR.cpp
@@ -465,7 +465,7 @@ void SPIRVTargetCodeGenInfo::setCUDAKernelCallingConvention(
 void CommonSPIRTargetCodeGenInfo::setOCLKernelStubCallingConvention(
     const FunctionType *&FT) const {
   FT = getABIInfo().getContext().adjustFunctionType(
-      FT, FT->getExtInfo().withCallingConv(CC_SpirFunction));
+      FT, FT->getExtInfo().withCallingConv(CC_C));
 }
 
 // LLVM currently assumes a null pointer has the bit pattern 0, but some GPU
diff --git a/clang/test/DebugInfo/Generic/cc.c 
b/clang/test/DebugInfo/Generic/cc.c
index e430e4c8ed87b..fc75c08e46a63 100644
--- a/clang/test/DebugInfo/Generic/cc.c
+++ b/clang/test/DebugInfo/Generic/cc.c
@@ -18,7 +18,6 @@
 //    CC_AAPCS,       // __attribute__((pcs("aapcs")))
 //    CC_AAPCS_VFP,   // __attribute__((pcs("aapcs-vfp")))
 //    CC_IntelOclBicc, // __attribute__((intel_ocl_bicc))
-//    CC_SpirFunction, // default for OpenCL functions on SPIR target
 //    CC_OpenCLKernel, // inferred for OpenCL kernels
 //    CC_Swift,        // __attribute__((swiftcall))
 //    CC_SwiftAsync,   // __attribute__((swiftasynccall))
diff --git a/clang/tools/libclang/CXType.cpp b/clang/tools/libclang/CXType.cpp
index 0063939dec423..912ce10afc251 100644
--- a/clang/tools/libclang/CXType.cpp
+++ b/clang/tools/libclang/CXType.cpp
@@ -730,7 +730,6 @@ CXCallingConv clang_getFunctionTypeCallingConv(CXType X) {
       TCALLINGCONV(RISCVVLSCall_16384);
       TCALLINGCONV(RISCVVLSCall_32768);
       TCALLINGCONV(RISCVVLSCall_65536);
-    case CC_SpirFunction: return CXCallingConv_Unexposed;
     case CC_DeviceKernel:
       return CXCallingConv_Unexposed;
       break;

>From edec8059f6e48be640e793e638f65cd6ffc408ce Mon Sep 17 00:00:00 2001
From: Arseniy Obolenskiy <[email protected]>
Date: Fri, 14 Aug 2026 07:52:13 +0200
Subject: [PATCH 2/2] fmt

---
 clang/include/clang/Basic/Specifiers.h | 64 +++++++++++++-------------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/clang/include/clang/Basic/Specifiers.h 
b/clang/include/clang/Basic/Specifiers.h
index a35f1cfd5f9d6..c1b7198565f07 100644
--- a/clang/include/clang/Basic/Specifiers.h
+++ b/clang/include/clang/Basic/Specifiers.h
@@ -277,38 +277,38 @@ namespace clang {
 
   /// CallingConv - Specifies the calling convention that a function uses.
   enum CallingConv {
-    CC_C,                 // __attribute__((cdecl))
-    CC_X86StdCall,        // __attribute__((stdcall))
-    CC_X86FastCall,       // __attribute__((fastcall))
-    CC_X86ThisCall,       // __attribute__((thiscall))
-    CC_X86VectorCall,     // __attribute__((vectorcall))
-    CC_X86Pascal,         // __attribute__((pascal))
-    CC_Win64,             // __attribute__((ms_abi))
-    CC_X86_64SysV,        // __attribute__((sysv_abi))
-    CC_X86RegCall,        // __attribute__((regcall))
-    CC_AAPCS,             // __attribute__((pcs("aapcs")))
-    CC_AAPCS_VFP,         // __attribute__((pcs("aapcs-vfp")))
-    CC_IntelOclBicc,      // __attribute__((intel_ocl_bicc))
-    CC_DeviceKernel,      // __attribute__((device_kernel))
-    CC_Swift,             // __attribute__((swiftcall))
-    CC_SwiftAsync,        // __attribute__((swiftasynccall))
-    CC_PreserveMost,      // __attribute__((preserve_most))
-    CC_PreserveAll,       // __attribute__((preserve_all))
-    CC_AArch64VectorCall, // __attribute__((aarch64_vector_pcs))
-    CC_AArch64SVEPCS,     // __attribute__((aarch64_sve_pcs))
-    CC_M68kRTD,           // __attribute__((m68k_rtd))
-    CC_PreserveNone,      // __attribute__((preserve_none))
-    CC_RISCVVectorCall,   // __attribute__((riscv_vector_cc))
-    CC_RISCVVLSCall_32,   // __attribute__((riscv_vls_cc(32)))
-    CC_RISCVVLSCall_64,   // __attribute__((riscv_vls_cc(64)))
-    CC_RISCVVLSCall_128,  // __attribute__((riscv_vls_cc)) or
-                          // __attribute__((riscv_vls_cc(128)))
-    CC_RISCVVLSCall_256,  // __attribute__((riscv_vls_cc(256)))
-    CC_RISCVVLSCall_512,  // __attribute__((riscv_vls_cc(512)))
-    CC_RISCVVLSCall_1024, // __attribute__((riscv_vls_cc(1024)))
-    CC_RISCVVLSCall_2048, // __attribute__((riscv_vls_cc(2048)))
-    CC_RISCVVLSCall_4096, // __attribute__((riscv_vls_cc(4096)))
-    CC_RISCVVLSCall_8192, // __attribute__((riscv_vls_cc(8192)))
+    CC_C,                  // __attribute__((cdecl))
+    CC_X86StdCall,         // __attribute__((stdcall))
+    CC_X86FastCall,        // __attribute__((fastcall))
+    CC_X86ThisCall,        // __attribute__((thiscall))
+    CC_X86VectorCall,      // __attribute__((vectorcall))
+    CC_X86Pascal,          // __attribute__((pascal))
+    CC_Win64,              // __attribute__((ms_abi))
+    CC_X86_64SysV,         // __attribute__((sysv_abi))
+    CC_X86RegCall,         // __attribute__((regcall))
+    CC_AAPCS,              // __attribute__((pcs("aapcs")))
+    CC_AAPCS_VFP,          // __attribute__((pcs("aapcs-vfp")))
+    CC_IntelOclBicc,       // __attribute__((intel_ocl_bicc))
+    CC_DeviceKernel,       // __attribute__((device_kernel))
+    CC_Swift,              // __attribute__((swiftcall))
+    CC_SwiftAsync,         // __attribute__((swiftasynccall))
+    CC_PreserveMost,       // __attribute__((preserve_most))
+    CC_PreserveAll,        // __attribute__((preserve_all))
+    CC_AArch64VectorCall,  // __attribute__((aarch64_vector_pcs))
+    CC_AArch64SVEPCS,      // __attribute__((aarch64_sve_pcs))
+    CC_M68kRTD,            // __attribute__((m68k_rtd))
+    CC_PreserveNone,       // __attribute__((preserve_none))
+    CC_RISCVVectorCall,    // __attribute__((riscv_vector_cc))
+    CC_RISCVVLSCall_32,    // __attribute__((riscv_vls_cc(32)))
+    CC_RISCVVLSCall_64,    // __attribute__((riscv_vls_cc(64)))
+    CC_RISCVVLSCall_128,   // __attribute__((riscv_vls_cc)) or
+                           // __attribute__((riscv_vls_cc(128)))
+    CC_RISCVVLSCall_256,   // __attribute__((riscv_vls_cc(256)))
+    CC_RISCVVLSCall_512,   // __attribute__((riscv_vls_cc(512)))
+    CC_RISCVVLSCall_1024,  // __attribute__((riscv_vls_cc(1024)))
+    CC_RISCVVLSCall_2048,  // __attribute__((riscv_vls_cc(2048)))
+    CC_RISCVVLSCall_4096,  // __attribute__((riscv_vls_cc(4096)))
+    CC_RISCVVLSCall_8192,  // __attribute__((riscv_vls_cc(8192)))
     CC_RISCVVLSCall_16384, // __attribute__((riscv_vls_cc(16384)))
     CC_RISCVVLSCall_32768, // __attribute__((riscv_vls_cc(32768)))
     CC_RISCVVLSCall_65536, // __attribute__((riscv_vls_cc(65536)))

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to