[clang] [clang][SYCL] Add SYCL spelling for AS attributes (PR #200849)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 1 08:51:34 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions c,cpp,h -- clang/test/SemaSYCL/address-space-opencl-sycl-compat.cpp clang/include/clang/Basic/AddressSpaces.h clang/include/clang/Sema/ParsedAttr.h clang/lib/AST/ItaniumMangle.cpp clang/lib/AST/Type.cpp clang/lib/AST/TypePrinter.cpp clang/lib/Basic/TargetInfo.cpp clang/lib/Basic/Targets/AArch64.h clang/lib/Basic/Targets/AMDGPU.cpp clang/lib/Basic/Targets/DirectX.h clang/lib/Basic/Targets/NVPTX.h clang/lib/Basic/Targets/SPIR.h clang/lib/Basic/Targets/SystemZ.h clang/lib/Basic/Targets/TCE.h clang/lib/Basic/Targets/WebAssembly.h clang/lib/Basic/Targets/X86.h clang/lib/Headers/__clang_spirv_builtins.h clang/lib/Parse/ParseDecl.cpp clang/lib/Sema/ParsedAttr.cpp clang/lib/Sema/SemaType.cpp clang/test/CodeGenSPIRV/Builtins/generic_cast_to_ptr_explicit.c clang/test/CodeGenSYCL/address-space-conversions.cpp clang/test/CodeGenSYCL/address-space-mangling.cpp clang/test/CodeGenSYCL/amd-address-space-conversions.cpp clang/test/CodeGenSYCL/cuda-address-space-conversions.cpp clang/test/SemaSYCL/address-space-conversions.cpp clang/test/SemaTemplate/address_space-dependent.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/include/clang/Basic/AddressSpaces.h b/clang/include/clang/Basic/AddressSpaces.h
index 58b04e50c..0f69d4cd2 100644
--- a/clang/include/clang/Basic/AddressSpaces.h
+++ b/clang/include/clang/Basic/AddressSpaces.h
@@ -36,7 +36,8 @@ enum class LangAS : unsigned {
opencl_constant,
opencl_private,
opencl_generic,
- // TODO: Remove opencl_global_device and opencl_global_host after corresponding
+ // TODO: Remove opencl_global_device and opencl_global_host after
+ // corresponding
// attributes are deprecated for the required time.
opencl_global_device,
opencl_global_host,
@@ -48,7 +49,8 @@ enum class LangAS : unsigned {
// SYCL specific address spaces.
sycl_global,
- // TODO: Remove sycl_global_device and sycl_global_host after corresponding attributes
+ // TODO: Remove sycl_global_device and sycl_global_host after corresponding
+ // attributes
// are deprecated for the required time.
sycl_global_device,
sycl_global_host,
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 9cdc340a2..6b7932f1d 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -89,9 +89,9 @@ bool Qualifiers::isTargetAddressSpaceSupersetOf(LangAS A, LangAS B,
(B == LangAS::sycl_private || B == LangAS::sycl_local ||
B == LangAS::sycl_global || B == LangAS::sycl_global_device ||
B == LangAS::sycl_global_host)) ||
- // Consider sycl_generic address space to be equivalent to default.
- (A == LangAS::Default && B == LangAS::sycl_generic) ||
- (B == LangAS::Default && A == LangAS::sycl_generic) ||
+ // Consider sycl_generic address space to be equivalent to default.
+ (A == LangAS::Default && B == LangAS::sycl_generic) ||
+ (B == LangAS::Default && A == LangAS::sycl_generic) ||
// In HIP device compilation, any cuda address space is allowed
// to implicitly cast into the default address space.
(A == LangAS::Default &&
diff --git a/clang/lib/Headers/__clang_spirv_builtins.h b/clang/lib/Headers/__clang_spirv_builtins.h
index 9b3ac8c13..5d324dc8f 100644
--- a/clang/lib/Headers/__clang_spirv_builtins.h
+++ b/clang/lib/Headers/__clang_spirv_builtins.h
@@ -31,7 +31,7 @@
#define __local __attribute__((sycl_local))
#define __private __attribute__((sycl_private))
#define __constant __attribute__((sycl_constant))
-#define __generic __attribute__((sycl_generic))
+#define __generic __attribute__((sycl_generic))
#else
#define __global __attribute__((opencl_global))
#define __local __attribute__((opencl_local))
``````````
</details>
https://github.com/llvm/llvm-project/pull/200849
More information about the cfe-commits
mailing list