-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[NFC][clang-sycl-linker] Avoid ambiguous call to CallingConv #161682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
both llvm and clang namespace have CallingConv. Add namespace prefix to avoid ambiguous call .
There was a problem hiding this 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 toCallingConv
references - Resolves compilation ambiguity between
llvm::CallingConv
andclang::CallingConv
@llvm/pr-subscribers-clang Author: Jinsong Ji (jsji) Changesboth llvm and clang namespace have CallingConv. Full diff: https://github.com/llvm/llvm-project/pull/161682.diff 1 Files Affected:
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:
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
FYI. @YuriPlyakhin |
…1682) 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 .