From: Erich Keane Date: Mon, 21 Jun 2021 19:50:02 +0000 (-0700) Subject: [SYCL][NFC] Ensure SYCL kernel for unique-stable-name is unqualified. X-Git-Tag: llvmorg-14-init~3432 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5013131875402539a249dca47c58cca7c359baf8;p=platform%2Fupstream%2Fllvm.git [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. --- diff --git a/clang/lib/Sema/SemaSYCL.cpp b/clang/lib/Sema/SemaSYCL.cpp index 3b48a53..7ae78b1 100644 --- a/clang/lib/Sema/SemaSYCL.cpp +++ b/clang/lib/Sema/SemaSYCL.cpp @@ -54,14 +54,14 @@ bool Sema::checkSYCLDeviceFunction(SourceLocation Loc, FunctionDecl *Callee) { // this was passed by value, and in SYCL2020, it is passed by reference. static QualType GetSYCLKernelObjectType(const FunctionDecl *KernelCaller) { assert(KernelCaller->getNumParams() > 0 && "Insufficient kernel parameters"); + // SYCL 1.2.1 QualType KernelParamTy = KernelCaller->getParamDecl(0)->getType(); // SYCL 2020 kernels are passed by reference. if (KernelParamTy->isReferenceType()) - return KernelParamTy->getPointeeType(); + KernelParamTy = KernelParamTy->getPointeeType(); - // SYCL 1.2.1 - return KernelParamTy; + return KernelParamTy.getUnqualifiedType(); } void Sema::AddSYCLKernelLambda(const FunctionDecl *FD) {