diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td index 14ca103987c72..cee65e7797063 100644 --- a/clang/include/clang/Basic/AttrDocs.td +++ b/clang/include/clang/Basic/AttrDocs.td @@ -1841,12 +1841,12 @@ def SYCLIntelKernelArgsRestrictDocs : Documentation { let Content = [{ The attribute ``intel::kernel_args_restrict`` is legal on device functions, and can be ignored on non-device functions. When applied to a function, lambda, or -function call operator (of a functor), the attribute is a hint to the compiler -equivalent to specifying the C99 restrict attribute on all pointer arguments or -the pointer member of any accessors, which are a function argument, lambda -capture, or functor member, of the callable to which the attribute was -applied. This effect is equivalent to annotating restrict on **all** kernel -pointer arguments in an OpenCL or SPIR-V kernel. +function call operator (of a function object), the attribute is a hint to the +compiler equivalent to specifying the C99 restrict attribute on all pointer +arguments or the pointer member of any accessors, which are a function argument, +lambda capture, or function object member, of the callable to which the +attribute was applied. This effect is equivalent to annotating restrict on +**all** kernel pointer arguments in an OpenCL or SPIR-V kernel. If ``intel::kernel_args_restrict`` is applied to a function called from a device kernel, the attribute is ignored and it is not propagated to a kernel. diff --git a/clang/lib/Sema/SemaSYCL.cpp b/clang/lib/Sema/SemaSYCL.cpp index a97ffeb3af574..70f2a44a05245 100644 --- a/clang/lib/Sema/SemaSYCL.cpp +++ b/clang/lib/Sema/SemaSYCL.cpp @@ -428,7 +428,7 @@ class MarkDeviceFunction : public RecursiveASTVisitor { else if (auto *A = FD->getAttr()) Attrs.insert(A); else if (auto *A = FD->getAttr()) { - // Allow the intel::kernel_args_restrict only on the lambda (functor + // Allow the intel::kernel_args_restrict only on the lambda (function // object) function, that is called directly from a kernel (i.e. the one // passed to the parallel_for function). Emit a warning and ignore all // other cases. diff --git a/clang/test/SemaSYCL/intel-restrict.cpp b/clang/test/SemaSYCL/intel-restrict.cpp index 5349ee2d0b8e5..4de7cd2750687 100644 --- a/clang/test/SemaSYCL/intel-restrict.cpp +++ b/clang/test/SemaSYCL/intel-restrict.cpp @@ -5,7 +5,7 @@ void func_ignore() {} -struct Functor { +struct FuncObj { [[intel::kernel_args_restrict]] void operator()() {} }; @@ -19,7 +19,7 @@ int main() { // CHECK-LABEL: FunctionDecl {{.*}} _ZTSZ4mainE12test_kernel1 // CHECK: SYCLIntelKernelArgsRestrictAttr kernel( - Functor()); + FuncObj()); // CHECK-LABEL: FunctionDecl {{.*}} _ZTSZ4mainE12test_kernel2 // CHECK: SYCLIntelKernelArgsRestrictAttr