-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[HLSL][NFC] Rename functions that collect resource bindings #125904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-hlsl Author: Helena Kotas (hekota) ChangesThere functions are analyzing and collecting resource bindings and the name should reflect that. The rename will make it clearer when we start adding more functions to process resources. Full diff: https://github.com/llvm/llvm-project/pull/125904.diff 2 Files Affected:
diff --git a/clang/include/clang/Sema/SemaHLSL.h b/clang/include/clang/Sema/SemaHLSL.h
index f4cd11f423a84a0..20376e980ab351a 100644
--- a/clang/include/clang/Sema/SemaHLSL.h
+++ b/clang/include/clang/Sema/SemaHLSL.h
@@ -160,9 +160,9 @@ class SemaHLSL : public SemaBase {
ResourceBindings Bindings;
private:
- void collectResourcesOnVarDecl(VarDecl *D);
- void collectResourcesOnUserRecordDecl(const VarDecl *VD,
- const RecordType *RT);
+ void collectResourceBindingsOnVarDecl(VarDecl *D);
+ void collectResourceBindingsOnUserRecordDecl(const VarDecl *VD,
+ const RecordType *RT);
void processExplicitBindingsOnDecl(VarDecl *D);
};
diff --git a/clang/lib/Sema/SemaHLSL.cpp b/clang/lib/Sema/SemaHLSL.cpp
index d748c10455289b9..6d06d72931f79f5 100644
--- a/clang/lib/Sema/SemaHLSL.cpp
+++ b/clang/lib/Sema/SemaHLSL.cpp
@@ -1323,8 +1323,8 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) {
// Walks though the global variable declaration, collects all resource binding
// requirements and adds them to Bindings
-void SemaHLSL::collectResourcesOnUserRecordDecl(const VarDecl *VD,
- const RecordType *RT) {
+void SemaHLSL::collectResourceBindingsOnUserRecordDecl(const VarDecl *VD,
+ const RecordType *RT) {
const RecordDecl *RD = RT->getDecl();
for (FieldDecl *FD : RD->fields()) {
const Type *Ty = FD->getType()->getUnqualifiedDesugaredType();
@@ -1354,7 +1354,7 @@ void SemaHLSL::collectResourcesOnUserRecordDecl(const VarDecl *VD,
// binding, which is something we are probably going to need to do later
// on. Hopefully nesting of structs in structs too many levels is
// unlikely.
- collectResourcesOnUserRecordDecl(VD, RT);
+ collectResourceBindingsOnUserRecordDecl(VD, RT);
}
}
}
@@ -1362,7 +1362,7 @@ void SemaHLSL::collectResourcesOnUserRecordDecl(const VarDecl *VD,
// Diagnore localized register binding errors for a single binding; does not
// diagnose resource binding on user record types, that will be done later
// in processResourceBindingOnDecl based on the information collected in
-// collectResourcesOnVarDecl.
+// collectResourceBindingsOnVarDecl.
// Returns false if the register binding is not valid.
static bool DiagnoseLocalRegisterBinding(Sema &S, SourceLocation &ArgLoc,
Decl *D, RegisterType RegType,
@@ -2788,7 +2788,7 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) {
// find all resources on decl
if (VD->getType()->isHLSLIntangibleType())
- collectResourcesOnVarDecl(VD);
+ collectResourceBindingsOnVarDecl(VD);
// process explicit bindings
processExplicitBindingsOnDecl(VD);
@@ -2797,7 +2797,7 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) {
// Walks though the global variable declaration, collects all resource binding
// requirements and adds them to Bindings
-void SemaHLSL::collectResourcesOnVarDecl(VarDecl *VD) {
+void SemaHLSL::collectResourceBindingsOnVarDecl(VarDecl *VD) {
assert(VD->hasGlobalStorage() && VD->getType()->isHLSLIntangibleType() &&
"expected global variable that contains HLSL resource");
@@ -2826,7 +2826,7 @@ void SemaHLSL::collectResourcesOnVarDecl(VarDecl *VD) {
// User defined record type
if (const RecordType *RT = dyn_cast<RecordType>(Ty))
- collectResourcesOnUserRecordDecl(VD, RT);
+ collectResourceBindingsOnUserRecordDecl(VD, RT);
}
// Walks though the explicit resource binding attributes on the declaration,
|
@llvm/pr-subscribers-clang Author: Helena Kotas (hekota) ChangesThere functions are analyzing and collecting resource bindings and the name should reflect that. The rename will make it clearer when we start adding more functions to process resources. Full diff: https://github.com/llvm/llvm-project/pull/125904.diff 2 Files Affected:
diff --git a/clang/include/clang/Sema/SemaHLSL.h b/clang/include/clang/Sema/SemaHLSL.h
index f4cd11f423a84a..20376e980ab351 100644
--- a/clang/include/clang/Sema/SemaHLSL.h
+++ b/clang/include/clang/Sema/SemaHLSL.h
@@ -160,9 +160,9 @@ class SemaHLSL : public SemaBase {
ResourceBindings Bindings;
private:
- void collectResourcesOnVarDecl(VarDecl *D);
- void collectResourcesOnUserRecordDecl(const VarDecl *VD,
- const RecordType *RT);
+ void collectResourceBindingsOnVarDecl(VarDecl *D);
+ void collectResourceBindingsOnUserRecordDecl(const VarDecl *VD,
+ const RecordType *RT);
void processExplicitBindingsOnDecl(VarDecl *D);
};
diff --git a/clang/lib/Sema/SemaHLSL.cpp b/clang/lib/Sema/SemaHLSL.cpp
index d748c10455289b..6d06d72931f79f 100644
--- a/clang/lib/Sema/SemaHLSL.cpp
+++ b/clang/lib/Sema/SemaHLSL.cpp
@@ -1323,8 +1323,8 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) {
// Walks though the global variable declaration, collects all resource binding
// requirements and adds them to Bindings
-void SemaHLSL::collectResourcesOnUserRecordDecl(const VarDecl *VD,
- const RecordType *RT) {
+void SemaHLSL::collectResourceBindingsOnUserRecordDecl(const VarDecl *VD,
+ const RecordType *RT) {
const RecordDecl *RD = RT->getDecl();
for (FieldDecl *FD : RD->fields()) {
const Type *Ty = FD->getType()->getUnqualifiedDesugaredType();
@@ -1354,7 +1354,7 @@ void SemaHLSL::collectResourcesOnUserRecordDecl(const VarDecl *VD,
// binding, which is something we are probably going to need to do later
// on. Hopefully nesting of structs in structs too many levels is
// unlikely.
- collectResourcesOnUserRecordDecl(VD, RT);
+ collectResourceBindingsOnUserRecordDecl(VD, RT);
}
}
}
@@ -1362,7 +1362,7 @@ void SemaHLSL::collectResourcesOnUserRecordDecl(const VarDecl *VD,
// Diagnore localized register binding errors for a single binding; does not
// diagnose resource binding on user record types, that will be done later
// in processResourceBindingOnDecl based on the information collected in
-// collectResourcesOnVarDecl.
+// collectResourceBindingsOnVarDecl.
// Returns false if the register binding is not valid.
static bool DiagnoseLocalRegisterBinding(Sema &S, SourceLocation &ArgLoc,
Decl *D, RegisterType RegType,
@@ -2788,7 +2788,7 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) {
// find all resources on decl
if (VD->getType()->isHLSLIntangibleType())
- collectResourcesOnVarDecl(VD);
+ collectResourceBindingsOnVarDecl(VD);
// process explicit bindings
processExplicitBindingsOnDecl(VD);
@@ -2797,7 +2797,7 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) {
// Walks though the global variable declaration, collects all resource binding
// requirements and adds them to Bindings
-void SemaHLSL::collectResourcesOnVarDecl(VarDecl *VD) {
+void SemaHLSL::collectResourceBindingsOnVarDecl(VarDecl *VD) {
assert(VD->hasGlobalStorage() && VD->getType()->isHLSLIntangibleType() &&
"expected global variable that contains HLSL resource");
@@ -2826,7 +2826,7 @@ void SemaHLSL::collectResourcesOnVarDecl(VarDecl *VD) {
// User defined record type
if (const RecordType *RT = dyn_cast<RecordType>(Ty))
- collectResourcesOnUserRecordDecl(VD, RT);
+ collectResourceBindingsOnUserRecordDecl(VD, RT);
}
// Walks though the explicit resource binding attributes on the declaration,
|
There functions are analyzing and collecting resource bindings and the name should reflect that. The rename will make it clearer when we start adding more functions to process resources.