[clang] [Clang][Docs] Document -Xarch_ better (PR #127890)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 19 12:07:58 PST 2025


https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/127890

>From d5efc8e10fabb0f2258e0bf5d2e4ce9c0686b911 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Wed, 19 Feb 2025 14:01:56 -0600
Subject: [PATCH] [Clang][Docs] Document -Xarch_ better

Summary:
This argument is esoteric and previously didn't even work consistently
across the targets. Now that's fixed we should document it better.
---
 clang/include/clang/Driver/Options.td | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 5ad187926e710..2b273c3f5c24d 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -932,9 +932,18 @@ def W_Joined : Joined<["-"], "W">, Group<W_Group>,
 def Xanalyzer : Separate<["-"], "Xanalyzer">,
   HelpText<"Pass <arg> to the static analyzer">, MetaVarName<"<arg>">,
   Group<StaticAnalyzer_Group>;
-def Xarch__ : JoinedAndSeparate<["-"], "Xarch_">, Flags<[NoXarchOption]>,
-  HelpText<"Pass <arg> to the compiliation if the target matches <arch>">,
-  MetaVarName<"<arch> <arg>">;
+def Xarch__
+    : JoinedAndSeparate<["-"], "Xarch_">,
+      Flags<[NoXarchOption]>,
+      HelpText<"Pass <arg> to the compiliation if the target matches <arch>">,
+      DocBrief<
+          [{Specifies that the argument should only be used if the compileation
+  target matches the specified architecture. This can be used with the target
+  CPU, triple architecture, or offloading host and device. This is most useful
+  for separating behavior undesirable on one of the targets when combining many
+  compilation jobs, as is commong with offloading. For example, -Xarch_x86_64,
+  -Xarch_gfx90a, and -Xarch_device are all valid selectors.}]>,
+      MetaVarName<"<arch> <arg>">;
 def Xarch_host : Separate<["-"], "Xarch_host">, Flags<[NoXarchOption]>,
   HelpText<"Pass <arg> to the CUDA/HIP host compilation">, MetaVarName<"<arg>">;
 def Xarch_device : Separate<["-"], "Xarch_device">, Flags<[NoXarchOption]>,



More information about the cfe-commits mailing list