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=list, -mtune=list + + 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_list : Flag<["-"], "mcpu=list">, Alias; +def mtune_EQ_list : Flag<["-"], "mtune=list">, 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=list and -mtune=list alises. +// RUN: %clang --target=x86_64-unknown-linux-gnu -mcpu=list 2>&1 | \ +// RUN: FileCheck %s --check-prefix=CHECK-X86 + +// RUN: %clang --target=x86_64-unknown-linux-gnu -mtune=list -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