[clang] [llvm] [HLSL] Implement the `reflect` HLSL function (PR #122992)

Finn Plummer via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 15 09:42:04 PST 2025


================
@@ -51,6 +51,38 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned BuiltinID,
     TheCall->setType(RetTy);
     break;
   }
+  case SPIRV::BI__builtin_spirv_reflect: {
+    if (SemaRef.checkArgCount(TheCall, 2))
+      return true;
+
+    ExprResult A = TheCall->getArg(0);
+    QualType ArgTyA = A.get()->getType();
+    auto *VTyA = ArgTyA->getAs<VectorType>();
----------------
inbelic wrote:

If you look through this file, there should be a helper function that will check what you are checking here

https://github.com/llvm/llvm-project/pull/122992


More information about the llvm-commits mailing list