================
@@ -4745,7 +4705,8 @@ void Driver::BuildActions(Compilation &C, DerivedArgList 
&Args,
     }
   }
 
-  if (C.getDefaultToolChain().getTriple().isDXIL()) {
+  if (C.getDefaultToolChain().getTriple().isDXIL() ||
+      C.getDefaultToolChain().getTriple().isSPIRV()) {
     const auto &TC =
         static_cast<const toolchains::HLSLToolChain 
&>(C.getDefaultToolChain());
----------------
bogner wrote:

I don't think checking `isSPIRV` is correct here. If the triple is a non-vulkan 
SPIRV target, we would have a SPIRVToolChain, and the static cast here is UB. 
Technically `isDXIL` doesn't really guarantee the toolchain here either though 
that probably can't come up in practice. I guess the simplest way to make this 
code "correct" would be to check the `getOS()` is either `Vulkan` or 
`ShaderModel`.

https://github.com/llvm/llvm-project/pull/188150
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to