================ @@ -12746,6 +12746,11 @@ def err_sycl_special_type_num_init_method : Error< "types with 'sycl_special_class' attribute must have one and only one '__init' " "method defined">; +//SYCL external attribute diagnostics +def err_sycl_attribute_internal_decl + : Error<"%0 attribute cannot be applied to a %select{function|variable}1" + " without external linkage">; ---------------- tahonermann wrote:
The only other uses of this diagnostic in downstream Intel repositories are for Intel extensions, so I don't think we need a generalized diagnostic. The SYCL 2020 specification doesn't support use of the `SYCL_EXTERNAL` macro with variables, so we don't need to support that (if we need such an extension, we might want to introduce a different attribute for it later). The suggested change below includes renaming, removal of applicability to variables, rephrasing inspired from `err_attribute_selectany_non_extern_data`, and style changes to match other nearby declarations. ```suggestion def err_sycl_external_invalid_linkage : Error< "'sycl_external' can only be applied to functions with external linkage">; ``` We'll eventually need to add diagnostics for at least the following scenarios as indicated in the SYCL 2020 specification in section [5.10.1](https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#subsec:syclexternal). I haven't checked whether diagnostics are already present in downstream Intel report. For scenarios that are straight forward to diagnose, we should add diagnostics now. For others, we need to ensure we file an issue or somehow track adding diagnostics later. Ideally, we would add tests for each of these now with appropriate FIXME annotations as needed. - The `sycl_external` attribute must be present on the first declaration of a function and may optionally be present on subsequent declarations. - If the device target does not support the generic address space, then functions declared with `sycl_external` cannot have parameter types or a return type that involves a raw pointer. - Functions declared with `sycl_external` cannot call `group::parallel_for_work_item()`. - Functions declared with `sycl_external` cannot be called from a `parallel_for_work_group` scope. https://github.com/llvm/llvm-project/pull/140282 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits