[PATCH] D114483: [SYCL] Add support for sycl_special_class attribute
Zahira Ammarguellat via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 17 11:21:09 PST 2021
zahiraam added inline comments.
================
Comment at: clang/lib/Sema/SemaDecl.cpp:9118
+ NewFD->getKind() == Decl::Kind::CXXMethod &&
+ NewFD->getName() == "__init" && D.isFunctionDefinition()) {
+ if (auto *def = Parent->getDefinition())
----------------
Fznamznon wrote:
> In our downstream we have not only `__init`, but `__init_esimd` as well there. I wonder how this case should be handled?
I think the presence of method `__init_esimd` implies the presence of ` __init` method so we could eventually check first for the presence of `__init_esimd` and if not present check for the presence of `__init`?
================
Comment at: clang/test/SemaSYCL/special-class-attribute.cpp:43
+class [[clang::sycl_special_class]] class8 { // expected-error {{types with 'sycl_special_class' attribute must have an '__init' method defined}}
+ void __init();
+};
----------------
Fznamznon wrote:
> Will detection of `__init` method work correctly if it is defined outside of the class?
> Maybe we should also mention that it should be not be defined in a separate library.
Both __init and __finalize must be defined inside the class/struct.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114483/new/
https://reviews.llvm.org/D114483
More information about the cfe-commits
mailing list