================ @@ -2161,6 +2186,22 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { return true; break; } + case Builtin::BI__builtin_hlsl_buffer_update_counter: { + if (SemaRef.checkArgCount(TheCall, 2) || + CheckResourceHandle(&SemaRef, TheCall, 0) || + CheckInt(&SemaRef, TheCall, 1)) + return true; ---------------- tex3d wrote:
Shouldn't this be a specific int type (not an integer type of any size/signedness)? If so, couldn't we have a check function that takes a single type and call it like `CheckArgType(&SemaRef, TheCall, 1, SemaRef.Context.IntTy)`? Or perhaps it could just be checked and diagnosed here instead? ```suggestion if (SemaRef.checkArgCount(TheCall, 2) || CheckResourceHandle(&SemaRef, TheCall, 0)) return true; if (TheCall->getArg(ArgIndex)->getType() != SemaRef.Context.IntTy) { S->Diag(TheCall->getArg(0)->getExprLoc(), diag::err_typecheck_expect_int) << ArgType; return true; } ``` https://github.com/llvm/llvm-project/pull/114148 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits