Skip to content

Commit 2240a33

Browse files
committed
Rename and merge functions.
1 parent 70912b1 commit 2240a33

File tree

6 files changed

+6
-13
lines changed

6 files changed

+6
-13
lines changed

clang/include/clang/AST/Type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2661,7 +2661,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
26612661
bool isHLSLSpecificType() const; // Any HLSL specific type
26622662
bool isHLSLBuiltinIntangibleType() const; // Any HLSL builtin intangible type
26632663
bool isHLSLAttributedResourceType() const;
2664-
bool isHLSLResourceClass() const;
2664+
bool isHLSLResourceRecord() const;
26652665
bool isHLSLIntangibleType()
26662666
const; // Any HLSL intangible type (builtin, array, class)
26672667

clang/lib/AST/Type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5114,7 +5114,7 @@ bool Type::hasSizedVLAType() const {
51145114
return false;
51155115
}
51165116

5117-
bool Type::isHLSLResourceClass() const {
5117+
bool Type::isHLSLResourceRecord() const {
51185118
return HLSLAttributedResourceType::findHandleTypeOnResource(this) != nullptr;
51195119
}
51205120

clang/lib/CodeGen/CGHLSLRuntime.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ llvm::Triple::ArchType CGHLSLRuntime::getArch() {
8989
static bool isResourceRecordTypeOrArrayOf(const clang::Type *Ty) {
9090
while (const ConstantArrayType *CAT = dyn_cast<ConstantArrayType>(Ty))
9191
Ty = CAT->getArrayElementTypeNoTypeQual();
92-
return CGHLSLRuntime::isResourceRecordType(Ty);
92+
return Ty->isHLSLResourceRecord();
9393
}
9494

9595
// Emits constant global variables for buffer constants declarations
@@ -653,7 +653,7 @@ void CGHLSLRuntime::handleGlobalVarDefinition(const VarDecl *VD,
653653
// on?
654654
return;
655655

656-
if (!isResourceRecordType(VD->getType().getTypePtr()))
656+
if (!VD->getType().getTypePtr()->isHLSLResourceRecord())
657657
// FIXME: Only simple declarations of resources are supported for now.
658658
// Arrays of resources or resources in user defined classes are
659659
// not implemented yet.
@@ -706,8 +706,3 @@ void CGHLSLRuntime::emitInitListOpaqueValues(CodeGenFunction &CGF,
706706
}
707707
}
708708
}
709-
710-
// Returns true if the type is an HLSL resource class
711-
bool CGHLSLRuntime::isResourceRecordType(const clang::Type *Ty) {
712-
return HLSLAttributedResourceType::findHandleTypeOnResource(Ty) != nullptr;
713-
}

clang/lib/CodeGen/CGHLSLRuntime.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ class CGHLSLRuntime {
134134
BufferResBinding(HLSLResourceBindingAttr *Attr);
135135
};
136136

137-
static bool isResourceRecordType(const clang::Type *Ty);
138-
139137
protected:
140138
CodeGenModule &CGM;
141139

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5596,7 +5596,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D,
55965596
T = D->getType();
55975597

55985598
if (getLangOpts().HLSL &&
5599-
getHLSLRuntime().isResourceRecordType(D->getType().getTypePtr())) {
5599+
D->getType().getTypePtr()->isHLSLResourceRecord()) {
56005600
Init = llvm::PoisonValue::get(getTypes().ConvertType(ASTTy));
56015601
NeedsGlobalCtor = true;
56025602
} else if (getLangOpts().CPlusPlus) {

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3068,7 +3068,7 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) {
30683068
const Type *VarType = VD->getType().getTypePtr();
30693069
while (VarType->isArrayType())
30703070
VarType = VarType->getArrayElementTypeNoTypeQual();
3071-
if (VarType->isHLSLResourceClass()) {
3071+
if (VarType->isHLSLResourceRecord()) {
30723072
// Make the variable for resources static. The global externally visible
30733073
// storage is accessed through the handle, which is a member. The variable
30743074
// itself is not externally visible.

0 commit comments

Comments
 (0)