Skip to content

Commit 5013131

Browse files
author
Erich Keane
committed
[SYCL][NFC] Ensure SYCL kernel for unique-stable-name is unqualified.
Discovered in our downstream, this function that is used to get the type of the kernel parameter type needs to be unqualified, otherwise when our downstream uses this function in a slightly different way, the kernel types no longer match.
1 parent a240358 commit 5013131

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ bool Sema::checkSYCLDeviceFunction(SourceLocation Loc, FunctionDecl *Callee) {
5454
// this was passed by value, and in SYCL2020, it is passed by reference.
5555
static QualType GetSYCLKernelObjectType(const FunctionDecl *KernelCaller) {
5656
assert(KernelCaller->getNumParams() > 0 && "Insufficient kernel parameters");
57+
// SYCL 1.2.1
5758
QualType KernelParamTy = KernelCaller->getParamDecl(0)->getType();
5859

5960
// SYCL 2020 kernels are passed by reference.
6061
if (KernelParamTy->isReferenceType())
61-
return KernelParamTy->getPointeeType();
62+
KernelParamTy = KernelParamTy->getPointeeType();
6263

63-
// SYCL 1.2.1
64-
return KernelParamTy;
64+
return KernelParamTy.getUnqualifiedType();
6565
}
6666

6767
void Sema::AddSYCLKernelLambda(const FunctionDecl *FD) {

0 commit comments

Comments
 (0)