[Driver] Revert -mcpu=?/-mtune=? and make -mcpu=help/-mtune=help unnamed
authorFangrui Song <i@maskray.me>
Tue, 28 Feb 2023 20:06:36 +0000 (12:06 -0800)
committerFangrui Song <i@maskray.me>
Tue, 28 Feb 2023 20:06:36 +0000 (12:06 -0800)
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.

clang/include/clang/Driver/Options.td
clang/test/Driver/print-supported-cpus.c

index 6bf5faf..70882e1 100644 (file)
@@ -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]>,
index 8e79a01..762c8b5 100644 (file)
@@ -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