Skip to content

Commit 531b3af

Browse files
committed
[Frontend] Replace CC1 option -masm-verbose with -fno-verbose-asm
Most OS✕target enable -fverbose-asm, so it makes sense to flip the CC1 option to reduce common command lines.
1 parent d0d076f commit 531b3af

14 files changed

+16
-17
lines changed

clang/include/clang/Driver/CC1Options.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,6 @@ def no_struct_path_tbaa : Flag<["-"], "no-struct-path-tbaa">,
282282
HelpText<"Turn off struct-path aware Type Based Alias Analysis">;
283283
def new_struct_path_tbaa : Flag<["-"], "new-struct-path-tbaa">,
284284
HelpText<"Enable enhanced struct-path aware Type Based Alias Analysis">;
285-
def masm_verbose : Flag<["-"], "masm-verbose">,
286-
HelpText<"Generate verbose assembly output">;
287285
def mdebug_pass : Separate<["-"], "mdebug-pass">,
288286
HelpText<"Enable additional debug output">;
289287
def mframe_pointer_EQ : Joined<["-"], "mframe-pointer=">,

clang/include/clang/Driver/Options.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,7 @@ def fno_register_global_dtors_with_atexit : Flag<["-"], "fno-register-global-dto
16081608
HelpText<"Don't use atexit or __cxa_atexit to register global destructors">;
16091609
def fno_unit_at_a_time : Flag<["-"], "fno-unit-at-a-time">, Group<f_Group>;
16101610
def fno_unwind_tables : Flag<["-"], "fno-unwind-tables">, Group<f_Group>;
1611-
def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Group<f_Group>;
1611+
def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Group<f_Group>, Flags<[CC1Option]>;
16121612
def fno_working_directory : Flag<["-"], "fno-working-directory">, Group<f_Group>;
16131613
def fno_wrapv : Flag<["-"], "fno-wrapv">, Group<f_Group>;
16141614
def fno_zero_initialized_in_bss : Flag<["-"], "fno-zero-initialized-in-bss">, Group<f_Group>;
@@ -1927,7 +1927,8 @@ def fuse_init_array : Flag<["-"], "fuse-init-array">, Group<f_Group>,
19271927
def fno_use_init_array : Flag<["-"], "fno-use-init-array">, Group<f_Group>, Flags<[CC1Option]>,
19281928
HelpText<"Don't use .init_array instead of .ctors">;
19291929
def fno_var_tracking : Flag<["-"], "fno-var-tracking">, Group<clang_ignored_f_Group>;
1930-
def fverbose_asm : Flag<["-"], "fverbose-asm">, Group<f_Group>;
1930+
def fverbose_asm : Flag<["-"], "fverbose-asm">, Group<f_Group>,
1931+
HelpText<"Generate verbose assembly output">;
19311932
def dA : Flag<["-"], "dA">, Alias<fverbose_asm>;
19321933
def fvisibility_EQ : Joined<["-"], "fvisibility=">, Group<f_Group>,
19331934
HelpText<"Set the default symbol visibility for all global declarations">, Values<"hidden,default">;

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4644,9 +4644,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
46444644
// Decide whether to use verbose asm. Verbose assembly is the default on
46454645
// toolchains which have the integrated assembler on by default.
46464646
bool IsIntegratedAssemblerDefault = TC.IsIntegratedAssemblerDefault();
4647-
if (Args.hasFlag(options::OPT_fverbose_asm, options::OPT_fno_verbose_asm,
4648-
IsIntegratedAssemblerDefault))
4649-
CmdArgs.push_back("-masm-verbose");
4647+
if (!Args.hasFlag(options::OPT_fverbose_asm, options::OPT_fno_verbose_asm,
4648+
IsIntegratedAssemblerDefault))
4649+
CmdArgs.push_back("-fno-verbose-asm");
46504650

46514651
if (!TC.useIntegratedAs())
46524652
CmdArgs.push_back("-no-integrated-as");

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
855855
Opts.CoverageMapping =
856856
Args.hasFlag(OPT_fcoverage_mapping, OPT_fno_coverage_mapping, false);
857857
Opts.DumpCoverageMapping = Args.hasArg(OPT_dump_coverage_mapping);
858-
Opts.AsmVerbose = Args.hasArg(OPT_masm_verbose);
858+
Opts.AsmVerbose = !Args.hasArg(OPT_fno_verbose_asm);
859859
Opts.PreserveAsmComments = !Args.hasArg(OPT_fno_preserve_as_comments);
860860
Opts.AssumeSaneOperatorNew = !Args.hasArg(OPT_fno_assume_sane_operator_new);
861861
Opts.ObjCAutoRefCountExceptions = Args.hasArg(OPT_fobjc_arc_exceptions);

clang/test/CodeGenObjC/debug-info-class-extension.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// FIXME: Check IR rather than asm, then triple is not needed.
2-
// RUN: %clang_cc1 -triple %itanium_abi_triple -masm-verbose -S -debug-info-kind=limited %s -o - | FileCheck %s
2+
// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited %s -o - | FileCheck %s
33

44
// CHECK: AT_APPLE_objc_complete_type
55

clang/test/CodeGenObjC/debug-info-class-extension2.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// FIXME: Check IR rather than asm, then triple is not needed.
2-
// RUN: %clang_cc1 -triple %itanium_abi_triple -masm-verbose -S -debug-info-kind=limited %s -o - | FileCheck %s
2+
// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited %s -o - | FileCheck %s
33
// CHECK: AT_APPLE_objc_complete_type
44

55
@interface Foo {} @end

clang/test/CodeGenObjC/debug-info-class-extension3.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -masm-verbose -S -debug-info-kind=limited %s -o - | FileCheck %s
1+
// RUN: %clang_cc1 -S -debug-info-kind=limited %s -o - | FileCheck %s
22

33
// CHECK-NOT: AT_APPLE_objc_complete_type
44

clang/test/CodeGenObjC/debug-info-property.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// FIXME: Check IR rather than asm, then triple is not needed.
2-
// RUN: %clang_cc1 -triple %itanium_abi_triple -masm-verbose -S -debug-info-kind=limited %s -o - | FileCheck %s
2+
// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited %s -o - | FileCheck %s
33

44
// CHECK: AT_APPLE_property_name
55
// CHECK: AT_APPLE_property_attribute

clang/test/CodeGenObjC/debug-info-property2.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// FIXME: Check IR rather than asm, then triple is not needed.
2-
// RUN: %clang_cc1 -triple %itanium_abi_triple -masm-verbose -S -debug-info-kind=limited %s -o - | FileCheck %s
2+
// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited %s -o - | FileCheck %s
33

44
// CHECK: AT_APPLE_property_name
55
@interface C {

clang/test/CodeGenObjC/debug-info-property4.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// FIXME: Check IR rather than asm, then triple is not needed.
2-
// RUN: %clang_cc1 -triple %itanium_abi_triple -masm-verbose -S -debug-info-kind=limited %s -o - | FileCheck %s
2+
// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited %s -o - | FileCheck %s
33

44
// CHECK: AT_APPLE_property_name
55
// CHECK-NOT: AT_APPLE_property_getter

0 commit comments

Comments
 (0)