Skip to content

Commit 9897ddc

Browse files
committed
Made the checking specific to the wave active functions
1 parent 347b8f8 commit 9897ddc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,10 +1865,10 @@ static bool CheckAnyScalarOrVector(Sema *S, CallExpr *TheCall,
18651865
return false;
18661866
}
18671867

1868-
static bool CheckNotBoolType(Sema *S, CallExpr *TheCall, unsigned ArgIndex) {
1868+
static bool CheckWaveActive(Sema *S, CallExpr *TheCall) {
18691869
QualType BoolType = S->getASTContext().BoolTy;
1870-
assert(TheCall->getNumArgs() >= ArgIndex);
1871-
QualType ArgType = TheCall->getArg(ArgIndex)->getType();
1870+
assert(TheCall->getNumArgs() >= 1);
1871+
QualType ArgType = TheCall->getArg(0)->getType();
18721872
auto *VTy = ArgType->getAs<VectorType>();
18731873
// is the bool or vector<bool>
18741874
if (S->Context.hasSameUnqualifiedType(ArgType, BoolType) ||
@@ -2197,7 +2197,7 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
21972197
// Ensure input expr type is a scalar/vector and the same as the return type
21982198
if (CheckAnyScalarOrVector(&SemaRef, TheCall, 0))
21992199
return true;
2200-
if (CheckNotBoolType(&SemaRef, TheCall, 0))
2200+
if (CheckWaveActive(&SemaRef, TheCall))
22012201
return true;
22022202
ExprResult Expr = TheCall->getArg(0);
22032203
QualType ArgTyExpr = Expr.get()->getType();

0 commit comments

Comments
 (0)