@@ -455,14 +456,22 @@ void createHostLayoutStructForBuffer(Sema &S,
HLSLBufferDecl *BufDecl) {
LS->setImplicit(true);
LS->startDefinition();
- for (const Decl *D : BufDecl->decls()) {
-const VarDecl *VD = dyn_cast(D);
+ for (Decl *D : BufDecl->decls()) {
+VarDec
@@ -39,7 +39,7 @@ typedef float EmptyArrayTypedef[10][0];
// CHECK: HLSLResourceClassAttr {{.*}} Implicit CBuffer
// CHECK: HLSLResourceAttr {{.*}} Implicit CBuffer
cbuffer CB {
- // CHECK: VarDecl {{.*}} col:9 used a1 'float'
+ // CHECK: VarDecl {{.*}} col:9 used a1 'hlsl_co
@@ -42,6 +42,7 @@ static const unsigned DirectXAddrSpaceMap[] = {
0, // ptr32_uptr
0, // ptr64
3, // hlsl_groupshared
+2, // hlsl_constant
tex3d wrote:
I'm surprised we neither use the `LangASMap` type for this array, nor
static_assert that th
https://github.com/tex3d edited https://github.com/llvm/llvm-project/pull/123411
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -83,6 +83,7 @@ const LangASMap AMDGPUTargetInfo::AMDGPUDefIsPrivMap = {
llvm::AMDGPUAS::FLAT_ADDRESS, // ptr32_uptr
llvm::AMDGPUAS::FLAT_ADDRESS, // ptr64
llvm::AMDGPUAS::FLAT_ADDRESS, // hlsl_groupshared
+llvm::AMDGPUAS::FLAT_ADDRESS, // hlsl_constant
--
@@ -2556,6 +2556,8 @@ std::string Qualifiers::getAddrSpaceAsString(LangAS AS) {
return "__funcref";
case LangAS::hlsl_groupshared:
return "groupshared";
+ case LangAS::hlsl_constant:
+return "hlsl_constant";
tex3d wrote:
Should hlsl addrspace ca
@@ -43,8 +43,8 @@ tbuffer B {
// AST-NEXT: FullComment
// AST-NEXT: ParagraphComment
// AST-NEXT: TextComment {{.*}} Text=" CBuffer decl."
-// AST-NEXT: VarDecl {{.*}} a 'float'
-// AST-NEXT: VarDecl {{.*}} b 'int'
+// AST-NEXT: VarDecl {{.*}} a 'hlsl_constant float'
+// AST-NE
https://github.com/tex3d commented:
I think this looks good, though I had some questions.
Looks like a test update is needed:
```
error: 'expected-error' diagnostics expected but not seen:
File
/var/lib/buildkite-agent/builds/linux-56-59b8f5d88-q72qr-1/llvm-project/github-pull-requests/clang