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

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


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

Summary:
This argument is esoteric and previously didn't even work consistently
across the targets. Now that's fixed we should document it better.


>From a7be26f70a9ba9a381e91b4c6257dc173444c6ef 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 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 5ad187926e710..b5598a44758a8 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -934,6 +934,12 @@ def Xanalyzer : Separate<["-"], "Xanalyzer">,
   Group<StaticAnalyzer_Group>;
 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>">;



More information about the cfe-commits mailing list