Skip to content

Conversation

@jsji
Copy link
Member

@jsji jsji commented Oct 2, 2025

both llvm and clang namespace have CallingConv.
Add namespace prefix to avoid ambiguous call .

both llvm and clang namespace have CallingConv.
Add namespace prefix to avoid ambiguous call .
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Oct 2, 2025
@jsji jsji requested review from bader and Copilot October 2, 2025 15:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR resolves a namespace ambiguity issue in the clang-sycl-linker where CallingConv exists in both the llvm and clang namespaces. The change explicitly prefixes all CallingConv references with the llvm:: namespace to eliminate the ambiguous call.

  • Adds explicit llvm:: namespace prefix to CallingConv references
  • Resolves compilation ambiguity between llvm::CallingConv and clang::CallingConv

@llvmbot
Copy link
Member

llvmbot commented Oct 2, 2025

@llvm/pr-subscribers-clang

Author: Jinsong Ji (jsji)

Changes

both llvm and clang namespace have CallingConv.
Add namespace prefix to avoid ambiguous call .


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

1 Files Affected:

  • (modified) clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp (+3-3)
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:

@jsji jsji self-assigned this Oct 2, 2025
@github-actions
Copy link

github-actions bot commented Oct 2, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@jsji
Copy link
Member Author

jsji commented Oct 2, 2025

FYI. @YuriPlyakhin

@jsji jsji requested review from jhuber6 and sarnex October 2, 2025 15:09
@jsji jsji enabled auto-merge (squash) October 2, 2025 15:13
@jsji jsji merged commit e3e0f69 into llvm:main Oct 2, 2025
9 checks passed
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
…1682)

both llvm and clang namespace have CallingConv.
Add namespace prefix to avoid ambiguous call .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants