Skip to content

Commit f6fd21d

Browse files
hekotaIcohedron
authored andcommitted
[HLSL][NFC] Rename functions that collect resource bindings (llvm#125904)
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.
1 parent 07a76e5 commit f6fd21d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

clang/include/clang/Sema/SemaHLSL.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ class SemaHLSL : public SemaBase {
160160
ResourceBindings Bindings;
161161

162162
private:
163-
void collectResourcesOnVarDecl(VarDecl *D);
164-
void collectResourcesOnUserRecordDecl(const VarDecl *VD,
165-
const RecordType *RT);
163+
void collectResourceBindingsOnVarDecl(VarDecl *D);
164+
void collectResourceBindingsOnUserRecordDecl(const VarDecl *VD,
165+
const RecordType *RT);
166166
void processExplicitBindingsOnDecl(VarDecl *D);
167167
};
168168

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,8 +1323,8 @@ SemaHLSL::TakeLocForHLSLAttribute(const HLSLAttributedResourceType *RT) {
13231323

13241324
// Walks though the global variable declaration, collects all resource binding
13251325
// requirements and adds them to Bindings
1326-
void SemaHLSL::collectResourcesOnUserRecordDecl(const VarDecl *VD,
1327-
const RecordType *RT) {
1326+
void SemaHLSL::collectResourceBindingsOnUserRecordDecl(const VarDecl *VD,
1327+
const RecordType *RT) {
13281328
const RecordDecl *RD = RT->getDecl();
13291329
for (FieldDecl *FD : RD->fields()) {
13301330
const Type *Ty = FD->getType()->getUnqualifiedDesugaredType();
@@ -1354,15 +1354,15 @@ void SemaHLSL::collectResourcesOnUserRecordDecl(const VarDecl *VD,
13541354
// binding, which is something we are probably going to need to do later
13551355
// on. Hopefully nesting of structs in structs too many levels is
13561356
// unlikely.
1357-
collectResourcesOnUserRecordDecl(VD, RT);
1357+
collectResourceBindingsOnUserRecordDecl(VD, RT);
13581358
}
13591359
}
13601360
}
13611361

13621362
// Diagnore localized register binding errors for a single binding; does not
13631363
// diagnose resource binding on user record types, that will be done later
13641364
// in processResourceBindingOnDecl based on the information collected in
1365-
// collectResourcesOnVarDecl.
1365+
// collectResourceBindingsOnVarDecl.
13661366
// Returns false if the register binding is not valid.
13671367
static bool DiagnoseLocalRegisterBinding(Sema &S, SourceLocation &ArgLoc,
13681368
Decl *D, RegisterType RegType,
@@ -2835,7 +2835,7 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) {
28352835

28362836
// find all resources on decl
28372837
if (VD->getType()->isHLSLIntangibleType())
2838-
collectResourcesOnVarDecl(VD);
2838+
collectResourceBindingsOnVarDecl(VD);
28392839

28402840
// process explicit bindings
28412841
processExplicitBindingsOnDecl(VD);
@@ -2844,7 +2844,7 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) {
28442844

28452845
// Walks though the global variable declaration, collects all resource binding
28462846
// requirements and adds them to Bindings
2847-
void SemaHLSL::collectResourcesOnVarDecl(VarDecl *VD) {
2847+
void SemaHLSL::collectResourceBindingsOnVarDecl(VarDecl *VD) {
28482848
assert(VD->hasGlobalStorage() && VD->getType()->isHLSLIntangibleType() &&
28492849
"expected global variable that contains HLSL resource");
28502850

@@ -2873,7 +2873,7 @@ void SemaHLSL::collectResourcesOnVarDecl(VarDecl *VD) {
28732873

28742874
// User defined record type
28752875
if (const RecordType *RT = dyn_cast<RecordType>(Ty))
2876-
collectResourcesOnUserRecordDecl(VD, RT);
2876+
collectResourceBindingsOnUserRecordDecl(VD, RT);
28772877
}
28782878

28792879
// Walks though the explicit resource binding attributes on the declaration,

0 commit comments

Comments
 (0)