================
@@ -1545,6 +1550,18 @@ def SYCLKernel : InheritableAttr {
   let Documentation = [SYCLKernelDocs];
 }
 
+def GlobalStorageNonLocalVar : SubsetSubject<Var,
+                                             [{S->hasGlobalStorage() &&
+                                               !S->isLocalVarDeclOrParm()}],
+                                             "global variables">;
+
+def SYCLExternal : InheritableAttr {
+  let Spellings = [GNU<"sycl_external">];
+  let Subjects = SubjectList<[Function, GlobalStorageNonLocalVar]>;
----------------
tahonermann wrote:

In SYCL 2020, the `SYCL_EXTERNAL` macro only applies to functions. Intel 
downstream repos allow the `sycl_device` attribute (which is used to implement 
`SYCL_EXTERNAL` there) to be applied to variables, but that isn't needed for 
SYCL 2020 conformance. If we later find a need to extend the semantics of 
`sycl_external` to variables, we should check with the SYCL WG to see if 
additions to the SYCL specification to support such semantics are warranted.

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

Reply via email to