[clang] [HLSL][NFC] Move common defines to the main header (hlsl.h) (PR #241626)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 11 18:05:31 PST 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Helena Kotas (hekota)
<details>
<summary>Changes</summary>
Move common `#define`s from included headers to the main header (`hlsl.h`). Includes `_HLSL_BUILTIN_ALIAS`, `HLSL_AVAILABILITY` and `_HLSL_AVAILABILITY_STAGE`.
---
Full diff: https://github.com/llvm/llvm-project/pull/241626.diff
3 Files Affected:
- (modified) clang/lib/Headers/hlsl.h (+10)
- (modified) clang/lib/Headers/hlsl/hlsl_alias_intrinsics.h (-8)
- (modified) clang/lib/Headers/hlsl/hlsl_resources.h (-5)
``````````diff
diff --git a/clang/lib/Headers/hlsl.h b/clang/lib/Headers/hlsl.h
index ff50c9f9b7ac21..7ed1d0535a04f6 100644
--- a/clang/lib/Headers/hlsl.h
+++ b/clang/lib/Headers/hlsl.h
@@ -16,6 +16,16 @@
#pragma clang diagnostic ignored "-Whlsl-dxc-compatability"
#endif
+#define _HLSL_AVAILABILITY(platform, version) \
+ __attribute__((availability(platform, introduced = version)))
+
+#define _HLSL_AVAILABILITY_STAGE(platform, version, stage) \
+ __attribute__(( \
+ availability(platform, introduced = version, environment = stage)))
+
+#define _HLSL_BUILTIN_ALIAS(builtin) \
+ __attribute__((clang_builtin_alias(builtin)))
+
// Basic types, type traits and type-independent templates.
#include "hlsl/hlsl_basic_types.h"
#include "hlsl/hlsl_detail.h"
diff --git a/clang/lib/Headers/hlsl/hlsl_alias_intrinsics.h b/clang/lib/Headers/hlsl/hlsl_alias_intrinsics.h
index 9761d7786455fd..4e4eb8c7143962 100644
--- a/clang/lib/Headers/hlsl/hlsl_alias_intrinsics.h
+++ b/clang/lib/Headers/hlsl/hlsl_alias_intrinsics.h
@@ -16,14 +16,6 @@ namespace hlsl {
// unsigned integer and floating point. Keeping this ordering consistent will
// help keep this file manageable as it grows.
-#define _HLSL_BUILTIN_ALIAS(builtin) \
- __attribute__((clang_builtin_alias(builtin)))
-#define _HLSL_AVAILABILITY(platform, version) \
- __attribute__((availability(platform, introduced = version)))
-#define _HLSL_AVAILABILITY_STAGE(platform, version, stage) \
- __attribute__(( \
- availability(platform, introduced = version, environment = stage)))
-
#ifdef __HLSL_ENABLE_16_BIT
#define _HLSL_16BIT_AVAILABILITY(platform, version, ...) \
__attribute__((availability(platform, introduced = version)))
diff --git a/clang/lib/Headers/hlsl/hlsl_resources.h b/clang/lib/Headers/hlsl/hlsl_resources.h
index 676b21817f6182..127c087dc05833 100644
--- a/clang/lib/Headers/hlsl/hlsl_resources.h
+++ b/clang/lib/Headers/hlsl/hlsl_resources.h
@@ -13,11 +13,6 @@
namespace hlsl {
-#define _HLSL_AVAILABILITY(platform, version) \
- __attribute__((availability(platform, introduced = version)))
-#define _HLSL_BUILTIN_ALIAS(builtin) \
- __attribute__((clang_builtin_alias(builtin)))
-
static const uint UAV_MEMORY = 0x1;
static const uint GROUP_SHARED_MEMORY = 0x2;
static const uint NODE_INPUT_MEMORY = 0x4;
``````````
</details>
https://github.com/llvm/llvm-project/pull/241626
More information about the cfe-commits
mailing list