This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Add -Xclang= as an alias for -Xclang
ClosedPublic

Authored by MaskRay on Aug 8 2022, 5:10 PM.

Details

Summary

Driver options taking a value typically use = as the separator, instead of a
space. Unfortunately many older driver options do not stick with the rule, but I
find -Xclang used a lot and will be convenient if -Xclang= exists.

For build systems using a string array instead of a string to indicate compiler options,
["-Xclang=-foo"] is more convenient than ["-Xclang", "-foo"].
If a tool wants to filter out -Xclang=-foo, it is trivial for the = form, but
complex for the space separated form.

Diff Detail

Event Timeline

MaskRay created this revision.Aug 8 2022, 5:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2022, 5:10 PM
MaskRay requested review of this revision.Aug 8 2022, 5:10 PM
Herald added a project: Restricted Project. · View Herald Transcript
MaskRay edited the summary of this revision. (Show Details)Aug 8 2022, 5:11 PM
MaskRay edited the summary of this revision. (Show Details)
jhuber6 accepted this revision.Aug 8 2022, 6:30 PM

LG

-Xopenmp-target= is somewhat different. The first joined argument is used to select a toolchain and the second, separate argument is the argument to pass. So something like -Xopenmp-target=nvptx64 -march=sm_70 would pass the architecture argument to the Nvidia toolchain only. The use of = can be a little confusing in this case.

This revision is now accepted and ready to land.Aug 8 2022, 6:30 PM

LG

-Xopenmp-target= is somewhat different. The first joined argument is used to select a toolchain and the second, separate argument is the argument to pass. So something like -Xopenmp-target=nvptx64 -march=sm_70 would pass the architecture argument to the Nvidia toolchain only. The use of = can be a little confusing in this case.

Thanks. Perhaps let me just drop -Xopenmp-target= from the description.

MaskRay edited the summary of this revision. (Show Details)Aug 8 2022, 7:01 PM
This revision was landed with ongoing or failed builds.Aug 8 2022, 7:05 PM
This revision was automatically updated to reflect the committed changes.