miyuki created this revision. miyuki added reviewers: aprantl, JDevlieghere.
This patch adds aliases for -Qn (-fno-ident) and -Qy (-fident) which look less cryptic than -Qn/-Qy. The aliases are compatible with GCC. https://reviews.llvm.org/D48021 Files: CodeGen/no-ident-version.c clang/Driver/Options.td Index: CodeGen/no-ident-version.c =================================================================== --- CodeGen/no-ident-version.c +++ CodeGen/no-ident-version.c @@ -2,8 +2,12 @@ // RUN: | FileCheck --check-prefix=CHECK-NONE %s // RUN: %clang_cc1 -Qn -emit-llvm -debug-info-kind=limited -o - %s \ // RUN: | FileCheck --check-prefix=CHECK-QN %s +// RUN: %clang_cc1 -fno-ident -emit-llvm -debug-info-kind=limited -o - %s \ +// RUN: | FileCheck --check-prefix=CHECK-QN %s // RUN: %clang_cc1 -Qy -emit-llvm -debug-info-kind=limited -o - %s \ // RUN: | FileCheck --check-prefix=CHECK-QY %s +// RUN: %clang_cc1 -fident -emit-llvm -debug-info-kind=limited -o - %s \ +// RUN: | FileCheck --check-prefix=CHECK-QY %s // CHECK-NONE: @main // CHECK-NONE: llvm.ident Index: clang/Driver/Options.td =================================================================== --- clang/Driver/Options.td +++ clang/Driver/Options.td @@ -404,6 +404,8 @@ HelpText<"Emit metadata containing compiler name and version">; def Qn : Flag<["-"], "Qn">, Flags<[CC1Option]>, HelpText<"Do not emit metadata containing compiler name and version">; +def : Flag<["-"], "fident">, Group<f_Group>, Alias<Qy>, Flags<[CC1Option]>; +def : Flag<["-"], "fno-ident">, Group<f_Group>, Alias<Qn>, Flags<[CC1Option]>; def Qunused_arguments : Flag<["-"], "Qunused-arguments">, Flags<[DriverOption, CoreOption]>, HelpText<"Don't emit warning for unused driver arguments">; def Q : Flag<["-"], "Q">, IgnoredGCCCompat; @@ -2840,7 +2842,6 @@ defm gcse_las: BooleanFFlag<"gcse-las">, Group<clang_ignored_gcc_optimization_f_Group>; defm gcse_sm: BooleanFFlag<"gcse-sm">, Group<clang_ignored_gcc_optimization_f_Group>; defm gnu : BooleanFFlag<"gnu">, Group<clang_ignored_f_Group>; -defm ident : BooleanFFlag<"ident">, Group<clang_ignored_f_Group>; defm implicit_templates : BooleanFFlag<"implicit-templates">, Group<clang_ignored_f_Group>; defm implement_inlines : BooleanFFlag<"implement-inlines">, Group<clang_ignored_f_Group>; defm merge_constants : BooleanFFlag<"merge-constants">, Group<clang_ignored_gcc_optimization_f_Group>;
Index: CodeGen/no-ident-version.c =================================================================== --- CodeGen/no-ident-version.c +++ CodeGen/no-ident-version.c @@ -2,8 +2,12 @@ // RUN: | FileCheck --check-prefix=CHECK-NONE %s // RUN: %clang_cc1 -Qn -emit-llvm -debug-info-kind=limited -o - %s \ // RUN: | FileCheck --check-prefix=CHECK-QN %s +// RUN: %clang_cc1 -fno-ident -emit-llvm -debug-info-kind=limited -o - %s \ +// RUN: | FileCheck --check-prefix=CHECK-QN %s // RUN: %clang_cc1 -Qy -emit-llvm -debug-info-kind=limited -o - %s \ // RUN: | FileCheck --check-prefix=CHECK-QY %s +// RUN: %clang_cc1 -fident -emit-llvm -debug-info-kind=limited -o - %s \ +// RUN: | FileCheck --check-prefix=CHECK-QY %s // CHECK-NONE: @main // CHECK-NONE: llvm.ident Index: clang/Driver/Options.td =================================================================== --- clang/Driver/Options.td +++ clang/Driver/Options.td @@ -404,6 +404,8 @@ HelpText<"Emit metadata containing compiler name and version">; def Qn : Flag<["-"], "Qn">, Flags<[CC1Option]>, HelpText<"Do not emit metadata containing compiler name and version">; +def : Flag<["-"], "fident">, Group<f_Group>, Alias<Qy>, Flags<[CC1Option]>; +def : Flag<["-"], "fno-ident">, Group<f_Group>, Alias<Qn>, Flags<[CC1Option]>; def Qunused_arguments : Flag<["-"], "Qunused-arguments">, Flags<[DriverOption, CoreOption]>, HelpText<"Don't emit warning for unused driver arguments">; def Q : Flag<["-"], "Q">, IgnoredGCCCompat; @@ -2840,7 +2842,6 @@ defm gcse_las: BooleanFFlag<"gcse-las">, Group<clang_ignored_gcc_optimization_f_Group>; defm gcse_sm: BooleanFFlag<"gcse-sm">, Group<clang_ignored_gcc_optimization_f_Group>; defm gnu : BooleanFFlag<"gnu">, Group<clang_ignored_f_Group>; -defm ident : BooleanFFlag<"ident">, Group<clang_ignored_f_Group>; defm implicit_templates : BooleanFFlag<"implicit-templates">, Group<clang_ignored_f_Group>; defm implement_inlines : BooleanFFlag<"implement-inlines">, Group<clang_ignored_f_Group>; defm merge_constants : BooleanFFlag<"merge-constants">, Group<clang_ignored_gcc_optimization_f_Group>;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits