diff --git a/clang/docs/CommandGuide/clang.rst b/clang/docs/CommandGuide/clang.rst --- a/clang/docs/CommandGuide/clang.rst +++ b/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= Specify that Clang should generate code for a specific processor family diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -4347,6 +4347,8 @@ MarshallingInfoFlag>; def mcpu_EQ_QUESTION : Flag<["-"], "mcpu=?">, Alias; def mtune_EQ_QUESTION : Flag<["-"], "mtune=?">, Alias; +def mcpu_EQ_help : Flag<["-"], "mcpu=help">, Alias; +def mtune_EQ_help : Flag<["-"], "mtune=help">, Alias; def time : Flag<["-"], "time">, HelpText<"Time individual commands">; def traditional_cpp : Flag<["-", "--"], "traditional-cpp">, Flags<[CC1Option]>, diff --git a/clang/test/Driver/print-supported-cpus.c b/clang/test/Driver/print-supported-cpus.c --- a/clang/test/Driver/print-supported-cpus.c +++ b/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