[clang] Add sycl_external attribute (PR #140282)

Tom Honermann via cfe-commits cfe-commits at lists.llvm.org
Fri May 16 20:45:28 PDT 2025


================
@@ -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">];
----------------
tahonermann wrote:

Since this attribute is a Clang extension, I think we should limit it to the Clang spelling for now as is done for the `sycl_kernel_entry_point` attribute.
```suggestion
  let Spellings = [Clang<"sycl_external">];
```

https://github.com/llvm/llvm-project/pull/140282


More information about the cfe-commits mailing list