[clang] [Clang] Fix sema checks thinking kernels aren't kernels (PR #104460)
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 15 09:04:27 PDT 2024
================
@@ -7163,7 +7165,8 @@ void Sema::ProcessDeclAttributeList(
} else if (const auto *A = D->getAttr<OpenCLIntelReqdSubGroupSizeAttr>()) {
Diag(D->getLocation(), diag::err_opencl_kernel_attr) << A;
D->setInvalidDecl();
- } else if (!D->hasAttr<CUDAGlobalAttr>()) {
+ } else if (!D->hasAttr<CUDAGlobalAttr>() &&
----------------
yxsamliu wrote:
This part checks amdgpu kernel attributes. I think we should move it inside the above if body and change it to
```
if (!D->hasAttr<CUDAGlobalAttr>() && !FnTy->getCallConv() != CallingConv::CC_AMDGPUKernelCall) {
//...
}
```
instead of using `else if`.
https://github.com/llvm/llvm-project/pull/104460
More information about the cfe-commits
mailing list