[clang] [llvm] [clang] Check validity of SYCL device target (PR #172366)

via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 30 12:00:59 PDT 2026


================
@@ -5111,6 +5111,10 @@ bool CompilerInvocation::CreateFromArgsImpl(
   if (LangOpts.OpenMPIsTargetDevice)
     Res.getTargetOpts().HostTriple = Res.getFrontendOpts().AuxTriple;
 
+  // Set the default triple for SYCL device compilation.
+  if (LangOpts.SYCLIsDevice && !Args.hasArg(options::OPT_triple))
+    Res.getTargetOpts().Triple = "spirv64-unknown-unknown";
----------------
elizabethandrews wrote:

I can expand the PR to fix issues with `-aux-triple` if you'd like but I'm not sure what those issues are. Do you have bug reports?

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


More information about the cfe-commits mailing list