Skip to content

Commit 007f601

Browse files
jhuber6jplehr
andauthored
[Clang][Docs] Document -Xarch_ better (llvm#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. --------- Co-authored-by: Jan Patrick Lehr <[email protected]>
1 parent 75bd46e commit 007f601

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -932,9 +932,20 @@ def W_Joined : Joined<["-"], "W">, Group<W_Group>,
932932
def Xanalyzer : Separate<["-"], "Xanalyzer">,
933933
HelpText<"Pass <arg> to the static analyzer">, MetaVarName<"<arg>">,
934934
Group<StaticAnalyzer_Group>;
935-
def Xarch__ : JoinedAndSeparate<["-"], "Xarch_">, Flags<[NoXarchOption]>,
936-
HelpText<"Pass <arg> to the compiliation if the target matches <arch>">,
937-
MetaVarName<"<arch> <arg>">;
935+
def Xarch__
936+
: JoinedAndSeparate<["-"], "Xarch_">,
937+
Flags<[NoXarchOption]>,
938+
HelpText<"Pass <arg> to the compilation if the target matches <arch>">,
939+
DocBrief<
940+
[{Specifies that the argument should only be used if the compilation
941+
target matches the specified architecture. This can be used with the target
942+
CPU, triple architecture, or offloading host and device. It is most useful
943+
for separating behavior undesirable on one of the targets when combining many
944+
compilation jobs, as is commong with offloading. For example, -Xarch_x86_64,
945+
-Xarch_gfx90a, and -Xarch_device are all valid selectors. -Xarch_device will
946+
forward the argument to the offloading device while -Xarch_host will target
947+
the host system, which can be used to suppress incompatible GPU arguments.}]>,
948+
MetaVarName<"<arch> <arg>">;
938949
def Xarch_host : Separate<["-"], "Xarch_host">, Flags<[NoXarchOption]>,
939950
HelpText<"Pass <arg> to the CUDA/HIP host compilation">, MetaVarName<"<arg>">;
940951
def Xarch_device : Separate<["-"], "Xarch_device">, Flags<[NoXarchOption]>,

0 commit comments

Comments
 (0)