Skip to content

Commit

Permalink
[Driver] Revert -mcpu=?/-mtune=? and make -mcpu=help/-mtune=help unnamed
Browse files Browse the repository at this point in the history
Follow-up to D144914.
-mcpu=help seems fine as a Clang extension not in GCC, because llc supports -mcpu=help.
-mcpu=? is a bad choice as ? may be expanded by the shell.
  • Loading branch information
MaskRay committed Feb 28, 2023
1 parent a783015 commit fb166b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
6 changes: 2 additions & 4 deletions clang/include/clang/Driver/Options.td
Expand Up @@ -4345,10 +4345,8 @@ def print_supported_cpus : Flag<["-", "--"], "print-supported-cpus">,
HelpText<"Print supported cpu models for the given target (if target is not specified,"
" it will print the supported cpus for the default target)">,
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 : Flag<["-"], "mcpu=help">, Alias<print_supported_cpus>;
def : Flag<["-"], "mtune=help">, Alias<print_supported_cpus>;
def time : Flag<["-"], "time">,
HelpText<"Time individual commands">;
def traditional_cpp : Flag<["-", "--"], "traditional-cpp">, Flags<[CC1Option]>,
Expand Down
7 changes: 0 additions & 7 deletions clang/test/Driver/print-supported-cpus.c
Expand Up @@ -6,13 +6,6 @@
// RUN: %clang --target=x86_64-unknown-linux-gnu --print-supported-cpus 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-X86

// Test -mcpu=? and -mtune=? alises.
// RUN: %clang --target=x86_64-unknown-linux-gnu -mcpu=? 2>&1 | \
// RUN: FileCheck %s --check-prefix=CHECK-X86

// 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
Expand Down

0 comments on commit fb166b4

Please sign in to comment.