From fb166b44f9332b2b4365b90ee3ec95cfce9c0ad5 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 28 Feb 2023 12:06:36 -0800 Subject: [PATCH] =?UTF-8?q?[Driver]=20Revert=20-mcpu=3D=3F/-mtune=3D=3F=20?= =?UTF-8?q?and=20make=20-mcpu=3Dhelp/-mtune=3Dhelp=20unnamed?= 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 | 6 ++---- clang/test/Driver/print-supported-cpus.c | 7 ------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 6bf5fafd6d7c..70882e110fa5 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>; -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 : Flag<["-"], "mcpu=help">, Alias; +def : 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 index 8e79a011fbec..762c8b5bac14 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