[clang] fb166b4 - [Driver] Revert -mcpu=?/-mtune=? and make -mcpu=help/-mtune=help unnamed

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 28 12:06:40 PST 2023


Author: Fangrui Song
Date: 2023-02-28T12:06:36-08:00
New Revision: fb166b44f9332b2b4365b90ee3ec95cfce9c0ad5

URL: https://github.com/llvm/llvm-project/commit/fb166b44f9332b2b4365b90ee3ec95cfce9c0ad5
DIFF: https://github.com/llvm/llvm-project/commit/fb166b44f9332b2b4365b90ee3ec95cfce9c0ad5.diff

LOG: [Driver] Revert -mcpu=?/-mtune=? and make -mcpu=help/-mtune=help unnamed

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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 6bf5fafd6d7cc..70882e110fa52 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -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]>,

diff  --git a/clang/test/Driver/print-supported-cpus.c b/clang/test/Driver/print-supported-cpus.c
index 8e79a011fbec8..762c8b5bac143 100644
--- a/clang/test/Driver/print-supported-cpus.c
+++ b/clang/test/Driver/print-supported-cpus.c
@@ -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


        


More information about the cfe-commits mailing list