[clang] [clang][SYCL] Add SYCL spelling for AS attributes (PR #200849)

Tom Honermann via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 12 18:11:18 PDT 2026


================
@@ -2000,6 +2000,11 @@ void TypePrinter::printAttributedAfter(const AttributedType *T,
   case attr::OpenCLConstantAddressSpace:
   case attr::OpenCLGenericAddressSpace:
   case attr::HLSLGroupSharedAddressSpace:
+  case attr::SYCLPrivateAddressSpace:
+  case attr::SYCLGlobalAddressSpace:
+  case attr::SYCLLocalAddressSpace:
+  case attr::SYCLConstantAddressSpace:
+  case attr::SYCLGenericAddressSpace:
     // FIXME: Update printAttributedBefore to print these once we generate
     // AttributedType nodes for them.
     break;
----------------
tahonermann wrote:

This is a curious comment. It seems there might have been an intent to eventually represent address space types using `AttributedType`, but that clearly never happened. I suggest we add an `llvm_unreachable()` call here as is done for other attributes; at least as long as doing so doesn't break any tests.
```suggestion
    llvm_unreachable("Address space attributes handled separately");
```

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


More information about the cfe-commits mailing list