Skip to content

Commit 8ddec06

Browse files
committed
Made the checking specific to the wave active functions
1 parent 9348035 commit 8ddec06

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
@@ -1853,10 +1853,10 @@ static bool CheckAnyScalarOrVector(Sema *S, CallExpr *TheCall,
18531853
return false;
18541854
}
18551855

1856-
static bool CheckNotBoolType(Sema *S, CallExpr *TheCall, unsigned ArgIndex) {
1856+
static bool CheckWaveActive(Sema *S, CallExpr *TheCall) {
18571857
QualType BoolType = S->getASTContext().BoolTy;
1858-
assert(TheCall->getNumArgs() >= ArgIndex);
1859-
QualType ArgType = TheCall->getArg(ArgIndex)->getType();
1858+
assert(TheCall->getNumArgs() >= 1);
1859+
QualType ArgType = TheCall->getArg(0)->getType();
18601860
auto *VTy = ArgType->getAs<VectorType>();
18611861
// is the bool or vector<bool>
18621862
if (S->Context.hasSameUnqualifiedType(ArgType, BoolType) ||
@@ -2185,7 +2185,7 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
21852185
// Ensure input expr type is a scalar/vector and the same as the return type
21862186
if (CheckAnyScalarOrVector(&SemaRef, TheCall, 0))
21872187
return true;
2188-
if (CheckNotBoolType(&SemaRef, TheCall, 0))
2188+
if (CheckWaveActive(&SemaRef, TheCall))
21892189
return true;
21902190
ExprResult Expr = TheCall->getArg(0);
21912191
QualType ArgTyExpr = Expr.get()->getType();

0 commit comments

Comments
 (0)