[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-x86_64-linux-bootstrap-asan` running on `sanitizer-buildbot1` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/52/builds/2992 Here is the relevan

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -110,6 +110,19 @@ DeclBindingInfo *ResourceBindings::addDeclBindingInfo(const VarDecl *VD, ResourceClass ResClass) { assert(getDeclBindingInfo(VD, ResClass) == nullptr && "DeclBindingInfo already added"); +#if

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/111203 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -985,88 +1034,85 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) { return LocInfo; } -// get the record decl from a var decl that we expect -// represents a resource -static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) { - const Type *

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
hekota wrote: > If there's no test coverage that exercises this case then it might be better > to remove the if guard so that it doesn't accidentally mask some other > problem we weren't expecting. The `if (!DBI)` case gets hit when parsing line 112 here where the user defined type `Eg12` has

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -110,6 +110,19 @@ DeclBindingInfo *ResourceBindings::addDeclBindingInfo(const VarDecl *VD, ResourceClass ResClass) { assert(getDeclBindingInfo(VD, ResClass) == nullptr && "DeclBindingInfo already added"); +#if

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -28,13 +28,60 @@ class AttributeCommonInfo; class IdentifierInfo; class ParsedAttr; class Scope; +class VarDecl; + +using llvm::dxil::ResourceClass; // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no // longer need to create builtin buffer types

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -110,6 +110,19 @@ DeclBindingInfo *ResourceBindings::addDeclBindingInfo(const VarDecl *VD, ResourceClass ResClass) { assert(getDeclBindingInfo(VD, ResClass) == nullptr && "DeclBindingInfo already added"); +#if

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -985,88 +1034,85 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) { return LocInfo; } -// get the record decl from a var decl that we expect -// represents a resource -static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) { - const Type *

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. Some comments added, but I think we're probably good to go here. https://github.com/llvm/llvm-project/pull/111203 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/111203 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/111203 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/111203 >From f545a14e11556c91d10b14617e3588fe5eae6d42 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 4 Oct 2024 12:21:51 -0700 Subject: [PATCH 1/7] [HLSL] Collect explicit resource binding information (part 1)

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) { llvm_unreachable("unexpected ResourceClass value"); } -static RegisterType getRegisterType(StringRef Slot) { +// Converts the first letter of string Slot to RegisterType. +// Returns false if the let

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -28,13 +28,60 @@ class AttributeCommonInfo; class IdentifierInfo; class ParsedAttr; class Scope; +class VarDecl; + +using llvm::dxil::ResourceClass; // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no // longer need to create builtin buffer types

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) { llvm_unreachable("unexpected ResourceClass value"); } -static RegisterType getRegisterType(StringRef Slot) { +// Converts the first letter of string Slot to RegisterType. +// Returns false if the let

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -985,88 +1034,85 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) { return LocInfo; } -// get the record decl from a var decl that we expect -// represents a resource -static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) { - const Type *

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -985,88 +1034,85 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) { return LocInfo; } -// get the record decl from a var decl that we expect -// represents a resource -static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) { - const Type *

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -28,13 +28,60 @@ class AttributeCommonInfo; class IdentifierInfo; class ParsedAttr; class Scope; +class VarDecl; + +using llvm::dxil::ResourceClass; // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no // longer need to create builtin buffer types

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) { llvm_unreachable("unexpected ResourceClass value"); } -static RegisterType getRegisterType(StringRef Slot) { +// Converts the first letter of string Slot to RegisterType. +// Returns false if the let

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -28,13 +28,60 @@ class AttributeCommonInfo; class IdentifierInfo; class ParsedAttr; class Scope; +class VarDecl; + +using llvm::dxil::ResourceClass; // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no // longer need to create builtin buffer types

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) { llvm_unreachable("unexpected ResourceClass value"); } -static RegisterType getRegisterType(StringRef Slot) { +// Converts the first letter of string Slot to RegisterType. +// Returns false if the let

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -28,13 +28,60 @@ class AttributeCommonInfo; class IdentifierInfo; class ParsedAttr; class Scope; +class VarDecl; + +using llvm::dxil::ResourceClass; // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no // longer need to create builtin buffer types

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -28,13 +28,60 @@ class AttributeCommonInfo; class IdentifierInfo; class ParsedAttr; class Scope; +class VarDecl; + +using llvm::dxil::ResourceClass; // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no // longer need to create builtin buffer types

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) { llvm_unreachable("unexpected ResourceClass value"); } -static RegisterType getRegisterType(StringRef Slot) { +// Converts the first letter of string Slot to RegisterType. +// Returns false if the let

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) { llvm_unreachable("unexpected ResourceClass value"); } -static RegisterType getRegisterType(StringRef Slot) { +// Converts the first letter of string Slot to RegisterType. +// Returns false if the let

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) { llvm_unreachable("unexpected ResourceClass value"); } -static RegisterType getRegisterType(StringRef Slot) { +// Converts the first letter of string Slot to RegisterType. +// Returns false if the let

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -28,13 +28,60 @@ class AttributeCommonInfo; class IdentifierInfo; class ParsedAttr; class Scope; +class VarDecl; + +using llvm::dxil::ResourceClass; // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no // longer need to create builtin buffer types

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Damyan Pepper via cfe-commits
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) { llvm_unreachable("unexpected ResourceClass value"); } -static RegisterType getRegisterType(StringRef Slot) { +// Converts the first letter of string Slot to RegisterType. +// Returns false if the let

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/111203 >From f545a14e11556c91d10b14617e3588fe5eae6d42 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 4 Oct 2024 12:21:51 -0700 Subject: [PATCH 1/6] [HLSL] Collect explicit resource binding information (part 1)

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Helena Kotas via cfe-commits
@@ -28,13 +28,60 @@ class AttributeCommonInfo; class IdentifierInfo; class ParsedAttr; class Scope; +class VarDecl; + +using llvm::dxil::ResourceClass; // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no // longer need to create builtin buffer types

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Justin Bogner via cfe-commits
@@ -28,13 +28,60 @@ class AttributeCommonInfo; class IdentifierInfo; class ParsedAttr; class Scope; +class VarDecl; + +using llvm::dxil::ResourceClass; // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no // longer need to create builtin buffer types

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/111203 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-16 Thread Justin Bogner via cfe-commits
@@ -985,88 +1034,94 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) { return LocInfo; } -// get the record decl from a var decl that we expect -// represents a resource -static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) { - const Type *

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/111203 >From f545a14e11556c91d10b14617e3588fe5eae6d42 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 4 Oct 2024 12:21:51 -0700 Subject: [PATCH 1/5] [HLSL] Collect explicit resource binding information (part 1)

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Helena Kotas via cfe-commits
@@ -2235,3 +2280,107 @@ QualType SemaHLSL::getInoutParameterType(QualType Ty) { Ty.addRestrict(); return Ty; } + +void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) { + if (VD->hasGlobalStorage()) { +// make sure the declaration has a complete type +if (SemaRef.Re

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Helena Kotas via cfe-commits
@@ -102,6 +152,15 @@ class SemaHLSL : public SemaBase { llvm::DenseMap LocsForHLSLAttributedResources; + + // List of all resource bindings + ResourceBindings Bindings; + +private: + void FindResourcesOnVarDecl(VarDecl *D); + void FindResourcesOnUserRecordDecl(const

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/111203 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/111203 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Helena Kotas via cfe-commits
@@ -4593,6 +4593,44 @@ def HLSLResourceBinding: InheritableAttr { let LangOpts = [HLSL]; let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>]; let Documentation = [HLSLResourceBindingDocs]; + let AdditionalMembers = [{ + enum class RegisterType : unsigned

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Justin Bogner via cfe-commits
bogner wrote: I think it's reasonable to limit this to implement things that are independently testable and leave the parts that aren't yet being used for some future change. https://github.com/llvm/llvm-project/pull/111203 ___ cfe-commits mailing li

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Helena Kotas via cfe-commits
hekota wrote: > I have to admit I'm pretty confused about what the code is trying to do - the > ratio of new code added to new tests / changes to the tests is a bit > surprising. This means I can't look at the tests to try and understand what > the code change is for, but it also points at may

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Justin Bogner via cfe-commits
@@ -985,88 +1026,92 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) { return LocInfo; } -// get the record decl from a var decl that we expect -// represents a resource -static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) { - const Type *

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Justin Bogner via cfe-commits
@@ -2235,3 +2280,107 @@ QualType SemaHLSL::getInoutParameterType(QualType Ty) { Ty.addRestrict(); return Ty; } + +void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) { + if (VD->hasGlobalStorage()) { +// make sure the declaration has a complete type +if (SemaRef.Re

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Justin Bogner via cfe-commits
@@ -102,6 +152,15 @@ class SemaHLSL : public SemaBase { llvm::DenseMap LocsForHLSLAttributedResources; + + // List of all resource bindings + ResourceBindings Bindings; + +private: + void FindResourcesOnVarDecl(VarDecl *D); + void FindResourcesOnUserRecordDecl(const

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Justin Bogner via cfe-commits
@@ -2235,3 +2280,107 @@ QualType SemaHLSL::getInoutParameterType(QualType Ty) { Ty.addRestrict(); return Ty; } + +void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) { + if (VD->hasGlobalStorage()) { +// make sure the declaration has a complete type +if (SemaRef.Re

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Justin Bogner via cfe-commits
@@ -83,6 +81,49 @@ static RegisterType getRegisterType(StringRef Slot) { } } +static ResourceClass getResourceClass(RegisterType RT) { + switch (RT) { + case RegisterType::SRV: +return ResourceClass::SRV; + case RegisterType::UAV: +return ResourceClass::UAV; + ca

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Justin Bogner via cfe-commits
@@ -985,88 +1026,92 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) { return LocInfo; } -// get the record decl from a var decl that we expect -// represents a resource -static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) { - const Type *

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-15 Thread Justin Bogner via cfe-commits
@@ -4593,6 +4593,44 @@ def HLSLResourceBinding: InheritableAttr { let LangOpts = [HLSL]; let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>]; let Documentation = [HLSLResourceBindingDocs]; + let AdditionalMembers = [{ + enum class RegisterType : unsigned

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-14 Thread Damyan Pepper via cfe-commits
@@ -28,13 +28,62 @@ class AttributeCommonInfo; class IdentifierInfo; class ParsedAttr; class Scope; +class VarDecl; + +using llvm::dxil::ResourceClass; // FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no // longer need to create builtin buffer types

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-14 Thread Damyan Pepper via cfe-commits
@@ -4593,6 +4593,44 @@ def HLSLResourceBinding: InheritableAttr { let LangOpts = [HLSL]; let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>]; let Documentation = [HLSLResourceBindingDocs]; + let AdditionalMembers = [{ + enum class RegisterType : unsigned

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-14 Thread Damyan Pepper via cfe-commits
@@ -83,6 +81,49 @@ static RegisterType getRegisterType(StringRef Slot) { } } +static ResourceClass getResourceClass(RegisterType RT) { + switch (RT) { + case RegisterType::SRV: +return ResourceClass::SRV; + case RegisterType::UAV: +return ResourceClass::UAV; + ca

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-14 Thread Damyan Pepper via cfe-commits
@@ -4593,6 +4593,44 @@ def HLSLResourceBinding: InheritableAttr { let LangOpts = [HLSL]; let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>]; let Documentation = [HLSLResourceBindingDocs]; + let AdditionalMembers = [{ + enum class RegisterType : unsigned

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-14 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/111203 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-14 Thread Damyan Pepper via cfe-commits
@@ -4593,6 +4593,44 @@ def HLSLResourceBinding: InheritableAttr { let LangOpts = [HLSL]; let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>]; let Documentation = [HLSLResourceBindingDocs]; + let AdditionalMembers = [{ + enum class RegisterType : unsigned

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-14 Thread Damyan Pepper via cfe-commits
@@ -83,6 +81,49 @@ static RegisterType getRegisterType(StringRef Slot) { } } +static ResourceClass getResourceClass(RegisterType RT) { + switch (RT) { + case RegisterType::SRV: +return ResourceClass::SRV; + case RegisterType::UAV: +return ResourceClass::UAV; + ca

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-14 Thread Damyan Pepper via cfe-commits
@@ -4593,6 +4593,44 @@ def HLSLResourceBinding: InheritableAttr { let LangOpts = [HLSL]; let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>]; let Documentation = [HLSLResourceBindingDocs]; + let AdditionalMembers = [{ + enum class RegisterType : unsigned

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-14 Thread Damyan Pepper via cfe-commits
@@ -4593,6 +4593,44 @@ def HLSLResourceBinding: InheritableAttr { let LangOpts = [HLSL]; let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>]; let Documentation = [HLSLResourceBindingDocs]; + let AdditionalMembers = [{ + enum class RegisterType : unsigned

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-14 Thread Damyan Pepper via cfe-commits
@@ -4593,6 +4593,44 @@ def HLSLResourceBinding: InheritableAttr { let LangOpts = [HLSL]; let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>]; let Documentation = [HLSLResourceBindingDocs]; + let AdditionalMembers = [{ + enum class RegisterType : unsigned

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-14 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp commented: I've looked through some of this and added some comments. I called out one place where there's some missing `const`s on members, but I think in general the code is not const correct and I didn't call out all the spots that I saw. I have to admit I'm pretty

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-10 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/111203 >From f545a14e11556c91d10b14617e3588fe5eae6d42 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 4 Oct 2024 12:21:51 -0700 Subject: [PATCH 1/4] [HLSL] Collect explicit resource binding information (part 1)

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/111203 >From f545a14e11556c91d10b14617e3588fe5eae6d42 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 4 Oct 2024 12:21:51 -0700 Subject: [PATCH 1/4] [HLSL] Collect explicit resource binding information (part 1)

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/111203 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-09 Thread Helena Kotas via cfe-commits
@@ -115,12 +114,14 @@ struct Eg13{ MySRV s1; MySRV s2; }; -// expected-warning@+4{{binding type 'u' only applies to types containing UAV resources}} // expected-warning@+3{{binding type 'u' only applies to types containing UAV resources}} -// expected-warning@+2{{binding

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-09 Thread Helena Kotas via cfe-commits
@@ -1135,21 +1147,19 @@ static void ValidateMultipleRegisterAnnotations(Sema &S, Decl *TheDecl, RegisterType otherRegType = getRegisterType(attr->getSlot()); if (RegisterTypesDetected[static_cast(otherRegType)]) { -if (PreviousConflicts[TheDecl].count(othe

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-09 Thread Helena Kotas via cfe-commits
@@ -4588,6 +4588,35 @@ def HLSLResourceBinding: InheritableAttr { let LangOpts = [HLSL]; let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>]; let Documentation = [HLSLResourceBindingDocs]; + let AdditionalMembers = [{ + enum class RegisterType : unsigned

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-09 Thread Helena Kotas via cfe-commits
@@ -2228,3 +2242,62 @@ QualType SemaHLSL::getInoutParameterType(QualType Ty) { Ty.addRestrict(); return Ty; } + +// Walks though existing explicit bindings, finds the actual resource class +// decl the binding applies to and sets it to attr->ResourceField. +// Additional pr

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-09 Thread Helena Kotas via cfe-commits
@@ -985,44 +983,43 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) { return LocInfo; } -// get the record decl from a var decl that we expect -// represents a resource -static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) { - const Type *T

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-09 Thread Helena Kotas via cfe-commits
@@ -2228,3 +2242,62 @@ QualType SemaHLSL::getInoutParameterType(QualType Ty) { Ty.addRestrict(); return Ty; } + +// Walks though existing explicit bindings, finds the actual resource class +// decl the binding applies to and sets it to attr->ResourceField. +// Additional pr

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/111203 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Collect explicit resource binding information (PR #111203)

2024-10-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/111203 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits