[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 3 11:37:23 PST 2025


================
@@ -1697,19 +1721,17 @@ llvm::opt::DerivedArgList *ToolChain::TranslateXarchArgs(
     } else if (A->getOption().matches(options::OPT_Xarch_host)) {
       NeedTrans = !IsDevice;
       Skip = IsDevice;
-    } else if (A->getOption().matches(options::OPT_Xarch__) && IsDevice) {
-      // Do not translate -Xarch_ options for non CUDA/HIP toolchain since
-      // they may need special translation.
-      // Skip this argument unless the architecture matches BoundArch
-      if (BoundArch.empty() || A->getValue(0) != BoundArch)
-        Skip = true;
-      else
-        NeedTrans = true;
+    } else if (A->getOption().matches(options::OPT_Xarch__)) {
----------------
Artem-B wrote:

Use of `-Xarch_host/device` should not block `-Xarch_<actual_arch>`.


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


More information about the cfe-commits mailing list