Skip to content

Commit 0c06b79

Browse files
author
Zhengxing Li
committed
Use appropriate name for input ID type diagnose function
1 parent acac11f commit 0c06b79

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

clang/include/clang/Sema/SemaHLSL.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ class SemaHLSL : public SemaBase {
137137

138138
bool CheckCompatibleParameterABI(FunctionDecl *New, FunctionDecl *Old);
139139

140-
bool isLegalTypeForHLSLSV_ThreadOrGroupID(QualType T, const ParsedAttr &AL);
140+
// Diagnose whether the input ID is uint/unit2/uint3 type.
141+
bool diagnoseInputIDType(QualType T, const ParsedAttr &AL);
141142

142143
ExprResult ActOnOutParamExpr(ParmVarDecl *Param, Expr *Arg);
143144

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,7 @@ void SemaHLSL::handleWaveSizeAttr(Decl *D, const ParsedAttr &AL) {
765765
D->addAttr(NewAttr);
766766
}
767767

768-
bool SemaHLSL::isLegalTypeForHLSLSV_ThreadOrGroupID(QualType T,
769-
const ParsedAttr &AL) {
768+
bool SemaHLSL::diagnoseInputIDType(QualType T, const ParsedAttr &AL) {
770769
const auto *VT = T->getAs<VectorType>();
771770

772771
if (!T->hasUnsignedIntegerRepresentation() ||
@@ -781,7 +780,7 @@ bool SemaHLSL::isLegalTypeForHLSLSV_ThreadOrGroupID(QualType T,
781780

782781
void SemaHLSL::handleSV_DispatchThreadIDAttr(Decl *D, const ParsedAttr &AL) {
783782
auto *VD = cast<ValueDecl>(D);
784-
if (!isLegalTypeForHLSLSV_ThreadOrGroupID(VD->getType(), AL))
783+
if (!diagnoseInputIDType(VD->getType(), AL))
785784
return;
786785

787786
D->addAttr(::new (getASTContext())
@@ -790,7 +789,7 @@ void SemaHLSL::handleSV_DispatchThreadIDAttr(Decl *D, const ParsedAttr &AL) {
790789

791790
void SemaHLSL::handleSV_GroupIDAttr(Decl *D, const ParsedAttr &AL) {
792791
auto *VD = cast<ValueDecl>(D);
793-
if (!isLegalTypeForHLSLSV_ThreadOrGroupID(VD->getType(), AL))
792+
if (!diagnoseInputIDType(VD->getType(), AL))
794793
return;
795794

796795
D->addAttr(::new (getASTContext()) HLSLSV_GroupIDAttr(getASTContext(), AL));

0 commit comments

Comments
 (0)