[clang] [llvm] [HLSL][DXIL] Implement `refract` intrinsic (PR #147342)
Sarah Spall via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 8 18:29:18 PDT 2025
================
@@ -46,6 +46,59 @@ static bool CheckAllArgsHaveSameType(Sema *S, CallExpr *TheCall) {
return false;
}
+static bool CheckAllArgTypesAreCorrect(
+ Sema *S, CallExpr *TheCall,
+ llvm::ArrayRef<
+ llvm::function_ref<bool(Sema *, SourceLocation, int, QualType)>>
+ Checks) {
+ unsigned NumArgs = TheCall->getNumArgs();
+ assert(Checks.size() == NumArgs &&
+ "Wrong number of checks for Number of args.");
+ // Apply each check to the corresponding argument
+ for (unsigned I = 0; I < NumArgs; ++I) {
+ Expr *Arg = TheCall->getArg(I);
+ if (Checks[I](S, Arg->getBeginLoc(), I + 1, Arg->getType()))
+ return true;
+ }
+ return false;
+}
+
+static bool CheckAllArgTypesAreCorrect(
----------------
spall wrote:
As we discussed offline, yes you should delete this function since it is unused.
https://github.com/llvm/llvm-project/pull/147342
More information about the llvm-commits
mailing list