[clang] [HLSL] Update Sema Checking Diagnostics for builtins (PR #138429)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Thu May 15 11:56:17 PDT 2025
================
@@ -2446,37 +2376,41 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
case Builtin::BI__builtin_hlsl_any: {
if (SemaRef.checkArgCount(TheCall, 1))
return true;
+ if (CheckAnyScalarOrVector(&SemaRef, TheCall, 0))
+ return true;
break;
}
case Builtin::BI__builtin_hlsl_asdouble: {
if (SemaRef.checkArgCount(TheCall, 2))
return true;
- if (CheckUnsignedIntRepresentation(&SemaRef, TheCall))
+ if (CheckScalarOrVector(&SemaRef, TheCall, SemaRef.Context.UnsignedIntTy,
+ 0)) // only check for uint
----------------
farzonl wrote:
add an inline arg comment so we can distinguish 0 from 1 args on lines 2387 and 2389
https://github.com/llvm/llvm-project/pull/138429
More information about the cfe-commits
mailing list