[PATCH] D151098: [Clang][Docs] Add help test to `-march` and `-mcpu` to suggest `-mcpu=help`

2023-05-22 Thread Joseph Huber via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGba9590d8bc76: [Clang][Docs] Add help test to `-march` and 
`-mcpu` to suggest `-mcpu=help` (authored by jhuber6).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151098/new/

https://reviews.llvm.org/D151098

Files:
  clang/include/clang/Driver/Options.td


Index: clang/include/clang/Driver/Options.td
===
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -3494,7 +3494,8 @@
 def mwatchos_version_min_EQ : Joined<["-"], "mwatchos-version-min=">, 
Group;
 def mwatchos_simulator_version_min_EQ : Joined<["-"], 
"mwatchos-simulator-version-min=">;
 def mwatchsimulator_version_min_EQ : Joined<["-"], 
"mwatchsimulator-version-min=">, Alias;
-def march_EQ : Joined<["-"], "march=">, Group, Flags<[CoreOption]>;
+def march_EQ : Joined<["-"], "march=">, Group, Flags<[CoreOption]>,
+  HelpText<"For a list of availible architectures for the target use 
'-mcpu=help'">;
 def masm_EQ : Joined<["-"], "masm=">, Group, Flags<[NoXarchOption]>;
 def inline_asm_EQ : Joined<["-"], "inline-asm=">, Group, 
Flags<[CC1Option]>,
   Values<"att,intel">,
@@ -3518,7 +3519,8 @@
 def mguard_EQ : Joined<["-"], "mguard=">, Group, 
Flags<[NoXarchOption]>,
   HelpText<"Enable or disable Control Flow Guard checks and guard tables 
emission">,
   Values<"none,cf,cf-nochecks">;
-def mcpu_EQ : Joined<["-"], "mcpu=">, Group;
+def mcpu_EQ : Joined<["-"], "mcpu=">, Group, 
+  HelpText<"For a list of availible CPUs for the target use '-mcpu=help'">;
 def mmcu_EQ : Joined<["-"], "mmcu=">, Group;
 def msim : Flag<["-"], "msim">, Group;
 def mdynamic_no_pic : Joined<["-"], "mdynamic-no-pic">, Group;


Index: clang/include/clang/Driver/Options.td
===
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -3494,7 +3494,8 @@
 def mwatchos_version_min_EQ : Joined<["-"], "mwatchos-version-min=">, Group;
 def mwatchos_simulator_version_min_EQ : Joined<["-"], "mwatchos-simulator-version-min=">;
 def mwatchsimulator_version_min_EQ : Joined<["-"], "mwatchsimulator-version-min=">, Alias;
-def march_EQ : Joined<["-"], "march=">, Group, Flags<[CoreOption]>;
+def march_EQ : Joined<["-"], "march=">, Group, Flags<[CoreOption]>,
+  HelpText<"For a list of availible architectures for the target use '-mcpu=help'">;
 def masm_EQ : Joined<["-"], "masm=">, Group, Flags<[NoXarchOption]>;
 def inline_asm_EQ : Joined<["-"], "inline-asm=">, Group, Flags<[CC1Option]>,
   Values<"att,intel">,
@@ -3518,7 +3519,8 @@
 def mguard_EQ : Joined<["-"], "mguard=">, Group, Flags<[NoXarchOption]>,
   HelpText<"Enable or disable Control Flow Guard checks and guard tables emission">,
   Values<"none,cf,cf-nochecks">;
-def mcpu_EQ : Joined<["-"], "mcpu=">, Group;
+def mcpu_EQ : Joined<["-"], "mcpu=">, Group, 
+  HelpText<"For a list of availible CPUs for the target use '-mcpu=help'">;
 def mmcu_EQ : Joined<["-"], "mmcu=">, Group;
 def msim : Flag<["-"], "msim">, Group;
 def mdynamic_no_pic : Joined<["-"], "mdynamic-no-pic">, Group;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D151098: [Clang][Docs] Add help test to `-march` and `-mcpu` to suggest `-mcpu=help`

2023-05-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment.

In D151098#4360758 , @jhuber6 wrote:

> In D151098#4360750 , @aaron.ballman 
> wrote:
>
>> LGTM, though it's a bit jarring that `-march` suggests using `-mcpu=help` 
>> (should we ensure that `-march=help` works on all targets instead?)
>
> Using `-march=help` works inadvertently because it will list the targets when 
> given an invalid one. We could probably map the `-mcpu=help` handling to 
> `-march=help` but I'm not entirely sure what the semantics should be there. 
> The distinction between `-march` and `-mcpu` is still not entirely clear to 
> me, it's just a matter of whether or not the target decided to choose one or 
> the other.

Oh, when I was trying it out, `-march=help` was not giving any useful 
information on some targets: https://godbolt.org/z/js4a64aTK -- FWIW, it's also 
unclear to me why and how these options differ.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151098/new/

https://reviews.llvm.org/D151098

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D151098: [Clang][Docs] Add help test to `-march` and `-mcpu` to suggest `-mcpu=help`

2023-05-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment.

In D151098#4360750 , @aaron.ballman 
wrote:

> LGTM, though it's a bit jarring that `-march` suggests using `-mcpu=help` 
> (should we ensure that `-march=help` works on all targets instead?)

Using `-march=help` works inadvertently because it will list the targets when 
given an invalid one. We could probably map the `-mcpu=help` handling to 
`-march=help` but I'm not entirely sure what the semantics should be there. The 
distinction between `-march` and `-mcpu` is still not entirely clear to me, 
it's just a matter of whether or not the target decided to choose one or the 
other.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151098/new/

https://reviews.llvm.org/D151098

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D151098: [Clang][Docs] Add help test to `-march` and `-mcpu` to suggest `-mcpu=help`

2023-05-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM, though it's a bit jarring that `-march` suggests using `-mcpu=help` 
(should we ensure that `-march=help` works on all targets instead?)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151098/new/

https://reviews.llvm.org/D151098

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D151098: [Clang][Docs] Add help test to `-march` and `-mcpu` to suggest `-mcpu=help`

2023-05-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision.
jhuber6 added reviewers: MaskRay, aaron.ballman.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Currently there is no documentation for these flags, users might find it
confusing to know which values are permitted. This change simply adds
documentation to suggest using `-mcpu=help` to list the availible target
names.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151098

Files:
  clang/include/clang/Driver/Options.td


Index: clang/include/clang/Driver/Options.td
===
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -3494,7 +3494,8 @@
 def mwatchos_version_min_EQ : Joined<["-"], "mwatchos-version-min=">, 
Group;
 def mwatchos_simulator_version_min_EQ : Joined<["-"], 
"mwatchos-simulator-version-min=">;
 def mwatchsimulator_version_min_EQ : Joined<["-"], 
"mwatchsimulator-version-min=">, Alias;
-def march_EQ : Joined<["-"], "march=">, Group, Flags<[CoreOption]>;
+def march_EQ : Joined<["-"], "march=">, Group, Flags<[CoreOption]>,
+  HelpText<"For a list of availible architectures for the target use 
'-mcpu=help'">;
 def masm_EQ : Joined<["-"], "masm=">, Group, Flags<[NoXarchOption]>;
 def inline_asm_EQ : Joined<["-"], "inline-asm=">, Group, 
Flags<[CC1Option]>,
   Values<"att,intel">,
@@ -3518,7 +3519,8 @@
 def mguard_EQ : Joined<["-"], "mguard=">, Group, 
Flags<[NoXarchOption]>,
   HelpText<"Enable or disable Control Flow Guard checks and guard tables 
emission">,
   Values<"none,cf,cf-nochecks">;
-def mcpu_EQ : Joined<["-"], "mcpu=">, Group;
+def mcpu_EQ : Joined<["-"], "mcpu=">, Group, 
+  HelpText<"For a list of availible CPUs for the target use '-mcpu=help'">;
 def mmcu_EQ : Joined<["-"], "mmcu=">, Group;
 def msim : Flag<["-"], "msim">, Group;
 def mdynamic_no_pic : Joined<["-"], "mdynamic-no-pic">, Group;


Index: clang/include/clang/Driver/Options.td
===
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -3494,7 +3494,8 @@
 def mwatchos_version_min_EQ : Joined<["-"], "mwatchos-version-min=">, Group;
 def mwatchos_simulator_version_min_EQ : Joined<["-"], "mwatchos-simulator-version-min=">;
 def mwatchsimulator_version_min_EQ : Joined<["-"], "mwatchsimulator-version-min=">, Alias;
-def march_EQ : Joined<["-"], "march=">, Group, Flags<[CoreOption]>;
+def march_EQ : Joined<["-"], "march=">, Group, Flags<[CoreOption]>,
+  HelpText<"For a list of availible architectures for the target use '-mcpu=help'">;
 def masm_EQ : Joined<["-"], "masm=">, Group, Flags<[NoXarchOption]>;
 def inline_asm_EQ : Joined<["-"], "inline-asm=">, Group, Flags<[CC1Option]>,
   Values<"att,intel">,
@@ -3518,7 +3519,8 @@
 def mguard_EQ : Joined<["-"], "mguard=">, Group, Flags<[NoXarchOption]>,
   HelpText<"Enable or disable Control Flow Guard checks and guard tables emission">,
   Values<"none,cf,cf-nochecks">;
-def mcpu_EQ : Joined<["-"], "mcpu=">, Group;
+def mcpu_EQ : Joined<["-"], "mcpu=">, Group, 
+  HelpText<"For a list of availible CPUs for the target use '-mcpu=help'">;
 def mmcu_EQ : Joined<["-"], "mmcu=">, Group;
 def msim : Flag<["-"], "msim">, Group;
 def mdynamic_no_pic : Joined<["-"], "mdynamic-no-pic">, Group;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits