Commit 6d18313
authored
[HLSL] Add internal linkage attribute to resources (#166844)
HLSL resources should not be externally visible from the module. We made sure of this by marking them `static` as soon as they were declared. However, this prevents us fixing issue #166458 because there is no way to know if a resource has been explicitly marked `static` by the user, and can therefore be assigned to.
This change moves from making all resources `static` to adding Clang internal linkage attribute to all non-static resource declarations as a global scope.
No explicit test added this change. There is a number of existing HLSL codegen tests that already verify that the resource globals are emitted as `internal global`.1 parent 5aec174 commit 6d18313
File tree
3 files changed
+10
-7
lines changed- clang
- lib/Sema
- test/AST/HLSL
3 files changed
+10
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3910 | 3910 | | |
3911 | 3911 | | |
3912 | 3912 | | |
3913 | | - | |
3914 | | - | |
3915 | | - | |
3916 | | - | |
3917 | | - | |
| 3913 | + | |
3918 | 3914 | | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
| 3919 | + | |
| 3920 | + | |
| 3921 | + | |
3919 | 3922 | | |
3920 | 3923 | | |
3921 | 3924 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
0 commit comments