Commit 19fe9b4
authored
[HLSL][TableGen] Add
This change adds resource handle type `__hlsl_resource_t` to the list of types recognized in the Clang's built-in functions prototype string.
HLSL has built-in resource classes and some of them have many methods, such as
[Texture2D](https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sm5-object-texture2d).
Most of these methods will be implemented by built-in functions that will take resource handle as an argument. This change enables us to move from generic `void(...)` prototype string for these methods and explicit argument checking in `SemaHLSL.cpp` to a prototype string with explicit argument types. Argument checking in `SemaHLSL.cpp` can be reduced to handle just the rules that cannot be expressed in the prototype string (for example verifying that the offset value in `__builtin_hlsl_buffer_update_counter` is `1` or `-1`).
In order to make this work, we now allow conversions from attributed resource handle type such as `__hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::contained_type(float)]]` to a plain non-attributed `__hlsl_resource_t` type.__hlsl_resource_t to known built-in function types (#163465)1 parent 9b7fd00 commit 19fe9b4
File tree
9 files changed
+96
-120
lines changed- clang
- include/clang/Basic
- lib
- AST
- Sema
- test
- AST/HLSL
- SemaHLSL/BuiltIns
- utils/TableGen
9 files changed
+96
-120
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4949 | 4949 | | |
4950 | 4950 | | |
4951 | 4951 | | |
4952 | | - | |
| 4952 | + | |
4953 | 4953 | | |
4954 | 4954 | | |
4955 | 4955 | | |
4956 | 4956 | | |
4957 | 4957 | | |
4958 | | - | |
| 4958 | + | |
4959 | 4959 | | |
4960 | 4960 | | |
4961 | 4961 | | |
4962 | 4962 | | |
4963 | 4963 | | |
4964 | | - | |
| 4964 | + | |
4965 | 4965 | | |
4966 | 4966 | | |
4967 | 4967 | | |
4968 | 4968 | | |
4969 | | - | |
4970 | | - | |
| 4969 | + | |
| 4970 | + | |
4971 | 4971 | | |
4972 | 4972 | | |
4973 | 4973 | | |
| |||
4979 | 4979 | | |
4980 | 4980 | | |
4981 | 4981 | | |
4982 | | - | |
| 4982 | + | |
4983 | 4983 | | |
4984 | 4984 | | |
4985 | 4985 | | |
4986 | 4986 | | |
4987 | 4987 | | |
4988 | | - | |
| 4988 | + | |
4989 | 4989 | | |
4990 | 4990 | | |
4991 | 4991 | | |
| |||
5213 | 5213 | | |
5214 | 5214 | | |
5215 | 5215 | | |
5216 | | - | |
| 5216 | + | |
5217 | 5217 | | |
5218 | 5218 | | |
5219 | 5219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12540 | 12540 | | |
12541 | 12541 | | |
12542 | 12542 | | |
| 12543 | + | |
| 12544 | + | |
| 12545 | + | |
| 12546 | + | |
12543 | 12547 | | |
12544 | 12548 | | |
12545 | 12549 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3058 | 3058 | | |
3059 | 3059 | | |
3060 | 3060 | | |
3061 | | - | |
3062 | | - | |
3063 | | - | |
3064 | | - | |
| 3061 | + | |
| 3062 | + | |
3065 | 3063 | | |
3066 | 3064 | | |
3067 | 3065 | | |
3068 | 3066 | | |
3069 | 3067 | | |
3070 | | - | |
3071 | | - | |
3072 | | - | |
3073 | | - | |
3074 | | - | |
3075 | | - | |
3076 | | - | |
3077 | | - | |
3078 | | - | |
3079 | | - | |
3080 | | - | |
| 3068 | + | |
| 3069 | + | |
3081 | 3070 | | |
3082 | 3071 | | |
3083 | 3072 | | |
3084 | 3073 | | |
3085 | 3074 | | |
3086 | | - | |
3087 | | - | |
3088 | | - | |
3089 | | - | |
3090 | | - | |
3091 | | - | |
3092 | | - | |
3093 | | - | |
3094 | | - | |
3095 | | - | |
3096 | | - | |
| 3075 | + | |
| 3076 | + | |
3097 | 3077 | | |
3098 | 3078 | | |
3099 | 3079 | | |
3100 | 3080 | | |
3101 | 3081 | | |
| 3082 | + | |
3102 | 3083 | | |
3103 | | - | |
3104 | | - | |
3105 | | - | |
3106 | | - | |
3107 | | - | |
3108 | | - | |
3109 | 3084 | | |
3110 | 3085 | | |
3111 | 3086 | | |
| |||
3114 | 3089 | | |
3115 | 3090 | | |
3116 | 3091 | | |
| 3092 | + | |
| 3093 | + | |
3117 | 3094 | | |
3118 | 3095 | | |
3119 | 3096 | | |
3120 | | - | |
3121 | | - | |
3122 | | - | |
3123 | | - | |
3124 | | - | |
3125 | | - | |
3126 | | - | |
3127 | | - | |
3128 | | - | |
3129 | | - | |
3130 | | - | |
3131 | | - | |
3132 | | - | |
3133 | | - | |
3134 | | - | |
3135 | | - | |
3136 | | - | |
3137 | | - | |
3138 | 3097 | | |
3139 | 3098 | | |
3140 | 3099 | | |
| |||
3434 | 3393 | | |
3435 | 3394 | | |
3436 | 3395 | | |
| 3396 | + | |
3437 | 3397 | | |
3438 | 3398 | | |
3439 | 3399 | | |
3440 | 3400 | | |
3441 | | - | |
3442 | | - | |
3443 | | - | |
3444 | | - | |
| 3401 | + | |
3445 | 3402 | | |
3446 | 3403 | | |
3447 | 3404 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1825 | 1825 | | |
1826 | 1826 | | |
1827 | 1827 | | |
1828 | | - | |
1829 | | - | |
1830 | | - | |
1831 | | - | |
1832 | | - | |
1833 | | - | |
1834 | | - | |
1835 | | - | |
1836 | | - | |
1837 | | - | |
1838 | | - | |
1839 | | - | |
1840 | | - | |
1841 | | - | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
1842 | 1856 | | |
1843 | 1857 | | |
1844 | 1858 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
| 100 | + | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
| 130 | + | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
| 152 | + | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| |||
0 commit comments