[PATCH] D144914: [Clang][Driver] Add -mcpu=help to clang
Michael Maitland via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 27 14:08:48 PST 2023
michaelmaitland updated this revision to Diff 500907.
michaelmaitland added a comment.
Change `list` -> `help`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144914/new/
https://reviews.llvm.org/D144914
Files:
clang/docs/CommandGuide/clang.rst
clang/include/clang/Driver/Options.td
clang/test/Driver/print-supported-cpus.c
Index: clang/test/Driver/print-supported-cpus.c
===================================================================
--- clang/test/Driver/print-supported-cpus.c
+++ clang/test/Driver/print-supported-cpus.c
@@ -13,6 +13,13 @@
// RUN: %clang --target=x86_64-unknown-linux-gnu -mtune=? -fuse-ld=dummy 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-X86
+// Test -mcpu=help and -mtune=help alises.
+// RUN: %clang --target=x86_64-unknown-linux-gnu -mcpu=help 2>&1 | \
+// RUN: FileCheck %s --check-prefix=CHECK-X86
+
+// RUN: %clang --target=x86_64-unknown-linux-gnu -mtune=help -fuse-ld=dummy 2>&1 | \
+// RUN: FileCheck %s --check-prefix=CHECK-X86
+
// CHECK-NOT: warning: argument unused during compilation
// CHECK-X86: Target: x86_64-unknown-linux-gnu
// CHECK-X86: corei7
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -4347,6 +4347,8 @@
MarshallingInfoFlag<FrontendOpts<"PrintSupportedCPUs">>;
def mcpu_EQ_QUESTION : Flag<["-"], "mcpu=?">, Alias<print_supported_cpus>;
def mtune_EQ_QUESTION : Flag<["-"], "mtune=?">, Alias<print_supported_cpus>;
+def mcpu_EQ_help : Flag<["-"], "mcpu=help">, Alias<print_supported_cpus>;
+def mtune_EQ_help : Flag<["-"], "mtune=help">, Alias<print_supported_cpus>;
def time : Flag<["-"], "time">,
HelpText<"Time individual commands">;
def traditional_cpp : Flag<["-", "--"], "traditional-cpp">, Flags<[CC1Option]>,
Index: clang/docs/CommandGuide/clang.rst
===================================================================
--- clang/docs/CommandGuide/clang.rst
+++ clang/docs/CommandGuide/clang.rst
@@ -373,6 +373,10 @@
Acts as an alias for :option:`--print-supported-cpus`.
+.. option:: -mcpu=help, -mtune=help
+
+ Acts as an alias for :option:`--print-supported-cpus`.
+
.. option:: -march=<cpu>
Specify that Clang should generate code for a specific processor family
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144914.500907.patch
Type: text/x-patch
Size: 2000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230227/345a465d/attachment.bin>
More information about the cfe-commits
mailing list