[clang] [NFC][clang-sycl-linker] Avoid ambiguous call to CallingConv (PR #161682)

Jinsong Ji via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 2 08:08:02 PDT 2025


https://github.com/jsji updated https://github.com/llvm/llvm-project/pull/161682

>From 1f54dd63443455ba80c0828112ee513fc29b1614 Mon Sep 17 00:00:00 2001
From: Jinsong Ji <jinsong.ji at intel.com>
Date: Thu, 2 Oct 2025 08:03:46 -0700
Subject: [PATCH 1/2] [NFC][clang-sycl-linker] Avoid ambiguous call to
 CallingConv

both llvm and clang namespace have CallingConv.
Add namespace prefix to avoid ambiguous call .
---
 clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp b/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
index 594c79a28047b..49d949d0fb4d6 100644
--- a/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
+++ b/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
@@ -462,9 +462,9 @@ static Error runAOTCompile(StringRef InputFile, StringRef OutputFile,
 
 // TODO: Consider using LLVM-IR metadata to identify globals of interest
 bool isKernel(const Function &F) {
-  const CallingConv::ID CC = F.getCallingConv();
-  return CC == CallingConv::SPIR_KERNEL || CC == CallingConv::AMDGPU_KERNEL ||
-         CC == CallingConv::PTX_Kernel;
+  const llvm::CallingConv::ID CC = F.getCallingConv();
+  return CC == llvm::CallingConv::SPIR_KERNEL || CC == llvm::CallingConv::AMDGPU_KERNEL ||
+         CC == llvm::CallingConv::PTX_Kernel;
 }
 
 /// Performs the following steps:

>From 63ce024d8880604552e762d190b6b3398805b59c Mon Sep 17 00:00:00 2001
From: Jinsong Ji <jinsong.ji at intel.com>
Date: Thu, 2 Oct 2025 08:07:50 -0700
Subject: [PATCH 2/2] clangformat

---
 clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp b/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
index 49d949d0fb4d6..de20e74360fbc 100644
--- a/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
+++ b/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
@@ -463,7 +463,8 @@ static Error runAOTCompile(StringRef InputFile, StringRef OutputFile,
 // TODO: Consider using LLVM-IR metadata to identify globals of interest
 bool isKernel(const Function &F) {
   const llvm::CallingConv::ID CC = F.getCallingConv();
-  return CC == llvm::CallingConv::SPIR_KERNEL || CC == llvm::CallingConv::AMDGPU_KERNEL ||
+  return CC == llvm::CallingConv::SPIR_KERNEL ||
+         CC == llvm::CallingConv::AMDGPU_KERNEL ||
          CC == llvm::CallingConv::PTX_Kernel;
 }
 



More information about the cfe-commits mailing list