[clang] Add spirv-val compilation step when targeting SPIR-V (PR #188150)

Finn Plummer via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 26 13:50:00 PDT 2026


================
@@ -4779,6 +4739,18 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
     }
   }
 
+  if (C.getDefaultToolChain().getTriple().isSPIRV()) {
+    const auto &TC =
+        static_cast<const toolchains::HLSLToolChain &>(C.getDefaultToolChain());
+
+    // Call spirv-val for SPIR-V when -Vd not in Args.
+    if (TC.requiresValidation(Args)) {
+      Action *LastAction = Actions.back();
+      Actions.push_back(
+          C.MakeAction<BinaryAnalyzeJobAction>(LastAction, types::TY_Object));
----------------
inbelic wrote:

Just double checking `types::TY_SPIRV` or similar exists instead of a generic object

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


More information about the cfe-commits mailing list