================
@@ -1807,44 +1791,116 @@ def OpenCLAccess : Attr {
   let Documentation = [OpenCLAccessDocs];
 }
 
-def OpenCLPrivateAddressSpace : TypeAttr {
+def OffloadPrivateAddressSpace : TypeAttr {
   let Spellings = [CustomKeyword<"__private">, CustomKeyword<"private">,
-                   Clang<"opencl_private">];
-  let Documentation = [OpenCLAddressSpacePrivateDocs];
+                   Clang<"opencl_private">, Clang<"sycl_private">];
+  let Documentation = [OffloadAddressSpacePrivateDocs];
+  let AdditionalMembers = [{
+    static inline bool isSYCLSpelling(const AttributeCommonInfo& A) {
+      return A.getAttributeSpellingListIndex() == GNU_sycl_private ||
+             A.getAttributeSpellingListIndex() == CXX11_clang_sycl_private ||
+             A.getAttributeSpellingListIndex() == C23_clang_sycl_private;
+    }
+    static inline LangAS getLangAS(const AttributeCommonInfo& A) {
+      return isSYCLSpelling(A) ? LangAS::sycl_private : LangAS::opencl_private;
+    }
+  }];
 }
 
-def OpenCLGlobalAddressSpace : TypeAttr {
+def OffloadGlobalAddressSpace : TypeAttr {
   let Spellings = [CustomKeyword<"__global">, CustomKeyword<"global">,
-                   Clang<"opencl_global">];
-  let Documentation = [OpenCLAddressSpaceGlobalDocs];
+                   Clang<"opencl_global">, Clang<"sycl_global">];
+  let Documentation = [OffloadAddressSpaceGlobalDocs];
+  let AdditionalMembers = [{
+    static inline bool isSYCLSpelling(const AttributeCommonInfo& A) {
+      return A.getAttributeSpellingListIndex() == GNU_sycl_global ||
+             A.getAttributeSpellingListIndex() == CXX11_clang_sycl_global ||
+             A.getAttributeSpellingListIndex() == C23_clang_sycl_global;
+    }
+    static inline LangAS getLangAS(const AttributeCommonInfo& A) {
+      return isSYCLSpelling(A) ? LangAS::sycl_global : LangAS::opencl_global;
+    }
+  }];
 }
 
-def OpenCLGlobalDeviceAddressSpace : TypeAttr {
-  let Spellings = [Clang<"opencl_global_device">];
-  let Documentation = [OpenCLAddressSpaceGlobalExtDocs];
+// TODO: Remove OffloadGlobalDeviceAddressSpace after deprecation.
+def OffloadGlobalDeviceAddressSpace : TypeAttr {
----------------
Fznamznon wrote:

Do we really need to do that given that opencl_global_host/device will be 
removed?

https://github.com/llvm/llvm-project/pull/200849
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to