Author: Fangrui Song Date: 2020-03-31T22:33:55-07:00 New Revision: 531b3aff3094dcd2e7ffed7f72ebd932ea386baf
URL: https://github.com/llvm/llvm-project/commit/531b3aff3094dcd2e7ffed7f72ebd932ea386baf DIFF: https://github.com/llvm/llvm-project/commit/531b3aff3094dcd2e7ffed7f72ebd932ea386baf.diff LOG: [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. Added: Modified: clang/include/clang/Driver/CC1Options.td clang/include/clang/Driver/Options.td clang/lib/Driver/ToolChains/Clang.cpp clang/lib/Frontend/CompilerInvocation.cpp clang/test/CodeGenObjC/debug-info-class-extension.m clang/test/CodeGenObjC/debug-info-class-extension2.m clang/test/CodeGenObjC/debug-info-class-extension3.m clang/test/CodeGenObjC/debug-info-property.m clang/test/CodeGenObjC/debug-info-property2.m clang/test/CodeGenObjC/debug-info-property4.m clang/test/CodeGenObjC/debug-info-property5.m clang/test/CodeGenObjC/property-dbg.m clang/test/Driver/clang-translation.c clang/test/Driver/integrated-as.c Removed: ################################################################################ diff --git a/clang/include/clang/Driver/CC1Options.td b/clang/include/clang/Driver/CC1Options.td index a9e2e306632b..ebefb20c4639 100644 --- a/clang/include/clang/Driver/CC1Options.td +++ b/clang/include/clang/Driver/CC1Options.td @@ -282,8 +282,6 @@ def no_struct_path_tbaa : Flag<["-"], "no-struct-path-tbaa">, HelpText<"Turn off struct-path aware Type Based Alias Analysis">; def new_struct_path_tbaa : Flag<["-"], "new-struct-path-tbaa">, HelpText<"Enable enhanced struct-path aware Type Based Alias Analysis">; -def masm_verbose : Flag<["-"], "masm-verbose">, - HelpText<"Generate verbose assembly output">; def mdebug_pass : Separate<["-"], "mdebug-pass">, HelpText<"Enable additional debug output">; def mframe_pointer_EQ : Joined<["-"], "mframe-pointer=">, diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 26098a8c062a..becabcf21878 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -1608,7 +1608,7 @@ def fno_register_global_dtors_with_atexit : Flag<["-"], "fno-register-global-dto HelpText<"Don't use atexit or __cxa_atexit to register global destructors">; def fno_unit_at_a_time : Flag<["-"], "fno-unit-at-a-time">, Group<f_Group>; def fno_unwind_tables : Flag<["-"], "fno-unwind-tables">, Group<f_Group>; -def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Group<f_Group>; +def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Group<f_Group>, Flags<[CC1Option]>; def fno_working_directory : Flag<["-"], "fno-working-directory">, Group<f_Group>; def fno_wrapv : Flag<["-"], "fno-wrapv">, Group<f_Group>; 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>, def fno_use_init_array : Flag<["-"], "fno-use-init-array">, Group<f_Group>, Flags<[CC1Option]>, HelpText<"Don't use .init_array instead of .ctors">; def fno_var_tracking : Flag<["-"], "fno-var-tracking">, Group<clang_ignored_f_Group>; -def fverbose_asm : Flag<["-"], "fverbose-asm">, Group<f_Group>; +def fverbose_asm : Flag<["-"], "fverbose-asm">, Group<f_Group>, + HelpText<"Generate verbose assembly output">; def dA : Flag<["-"], "dA">, Alias<fverbose_asm>; def fvisibility_EQ : Joined<["-"], "fvisibility=">, Group<f_Group>, HelpText<"Set the default symbol visibility for all global declarations">, Values<"hidden,default">; diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 8773468ddbe6..161af89a67e1 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -4644,9 +4644,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // Decide whether to use verbose asm. Verbose assembly is the default on // toolchains which have the integrated assembler on by default. bool IsIntegratedAssemblerDefault = TC.IsIntegratedAssemblerDefault(); - if (Args.hasFlag(options::OPT_fverbose_asm, options::OPT_fno_verbose_asm, - IsIntegratedAssemblerDefault)) - CmdArgs.push_back("-masm-verbose"); + if (!Args.hasFlag(options::OPT_fverbose_asm, options::OPT_fno_verbose_asm, + IsIntegratedAssemblerDefault)) + CmdArgs.push_back("-fno-verbose-asm"); if (!TC.useIntegratedAs()) CmdArgs.push_back("-no-integrated-as"); diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index f8129ea4ac26..e0567138b782 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -855,7 +855,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.CoverageMapping = Args.hasFlag(OPT_fcoverage_mapping, OPT_fno_coverage_mapping, false); Opts.DumpCoverageMapping = Args.hasArg(OPT_dump_coverage_mapping); - Opts.AsmVerbose = Args.hasArg(OPT_masm_verbose); + Opts.AsmVerbose = !Args.hasArg(OPT_fno_verbose_asm); Opts.PreserveAsmComments = !Args.hasArg(OPT_fno_preserve_as_comments); Opts.AssumeSaneOperatorNew = !Args.hasArg(OPT_fno_assume_sane_operator_new); Opts.ObjCAutoRefCountExceptions = Args.hasArg(OPT_fobjc_arc_exceptions); diff --git a/clang/test/CodeGenObjC/debug-info-class-extension.m b/clang/test/CodeGenObjC/debug-info-class-extension.m index a27810cce743..db654e6a60a5 100644 --- a/clang/test/CodeGenObjC/debug-info-class-extension.m +++ b/clang/test/CodeGenObjC/debug-info-class-extension.m @@ -1,5 +1,5 @@ // FIXME: Check IR rather than asm, then triple is not needed. -// RUN: %clang_cc1 -triple %itanium_abi_triple -masm-verbose -S -debug-info-kind=limited %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited %s -o - | FileCheck %s // CHECK: AT_APPLE_objc_complete_type diff --git a/clang/test/CodeGenObjC/debug-info-class-extension2.m b/clang/test/CodeGenObjC/debug-info-class-extension2.m index d4750c120f60..ea7865b4ac5b 100644 --- a/clang/test/CodeGenObjC/debug-info-class-extension2.m +++ b/clang/test/CodeGenObjC/debug-info-class-extension2.m @@ -1,5 +1,5 @@ // FIXME: Check IR rather than asm, then triple is not needed. -// RUN: %clang_cc1 -triple %itanium_abi_triple -masm-verbose -S -debug-info-kind=limited %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited %s -o - | FileCheck %s // CHECK: AT_APPLE_objc_complete_type @interface Foo {} @end diff --git a/clang/test/CodeGenObjC/debug-info-class-extension3.m b/clang/test/CodeGenObjC/debug-info-class-extension3.m index a9cf6f6a5c59..f81445b47a21 100644 --- a/clang/test/CodeGenObjC/debug-info-class-extension3.m +++ b/clang/test/CodeGenObjC/debug-info-class-extension3.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -masm-verbose -S -debug-info-kind=limited %s -o - | FileCheck %s +// RUN: %clang_cc1 -S -debug-info-kind=limited %s -o - | FileCheck %s // CHECK-NOT: AT_APPLE_objc_complete_type diff --git a/clang/test/CodeGenObjC/debug-info-property.m b/clang/test/CodeGenObjC/debug-info-property.m index 9b471be23dbd..ca013b24be42 100644 --- a/clang/test/CodeGenObjC/debug-info-property.m +++ b/clang/test/CodeGenObjC/debug-info-property.m @@ -1,5 +1,5 @@ // FIXME: Check IR rather than asm, then triple is not needed. -// RUN: %clang_cc1 -triple %itanium_abi_triple -masm-verbose -S -debug-info-kind=limited %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited %s -o - | FileCheck %s // CHECK: AT_APPLE_property_name // CHECK: AT_APPLE_property_attribute diff --git a/clang/test/CodeGenObjC/debug-info-property2.m b/clang/test/CodeGenObjC/debug-info-property2.m index 6a15922c932c..7e0a5e9f954b 100644 --- a/clang/test/CodeGenObjC/debug-info-property2.m +++ b/clang/test/CodeGenObjC/debug-info-property2.m @@ -1,5 +1,5 @@ // FIXME: Check IR rather than asm, then triple is not needed. -// RUN: %clang_cc1 -triple %itanium_abi_triple -masm-verbose -S -debug-info-kind=limited %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited %s -o - | FileCheck %s // CHECK: AT_APPLE_property_name @interface C { diff --git a/clang/test/CodeGenObjC/debug-info-property4.m b/clang/test/CodeGenObjC/debug-info-property4.m index f862c85b344d..1f489f2f6b63 100644 --- a/clang/test/CodeGenObjC/debug-info-property4.m +++ b/clang/test/CodeGenObjC/debug-info-property4.m @@ -1,5 +1,5 @@ // FIXME: Check IR rather than asm, then triple is not needed. -// RUN: %clang_cc1 -triple %itanium_abi_triple -masm-verbose -S -debug-info-kind=limited %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited %s -o - | FileCheck %s // CHECK: AT_APPLE_property_name // CHECK-NOT: AT_APPLE_property_getter diff --git a/clang/test/CodeGenObjC/debug-info-property5.m b/clang/test/CodeGenObjC/debug-info-property5.m index 191da9c16fcc..8b70f1ff2082 100644 --- a/clang/test/CodeGenObjC/debug-info-property5.m +++ b/clang/test/CodeGenObjC/debug-info-property5.m @@ -1,5 +1,5 @@ // FIXME: Check IR rather than asm, then triple is not needed. -// RUN: %clang_cc1 -triple %itanium_abi_triple -masm-verbose -S -debug-info-kind=limited %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited %s -o - | FileCheck %s // CHECK: AT_APPLE_property_name // CHECK: AT_APPLE_property_getter diff --git a/clang/test/CodeGenObjC/property-dbg.m b/clang/test/CodeGenObjC/property-dbg.m index fb70747f5db8..f15213131ccc 100644 --- a/clang/test/CodeGenObjC/property-dbg.m +++ b/clang/test/CodeGenObjC/property-dbg.m @@ -1,5 +1,5 @@ // FIXME: Check IR rather than asm, then triple is not needed. -// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited -masm-verbose -x objective-c < %s | grep DW_AT_name +// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited -x objective-c < %s | grep DW_AT_name @interface Foo { int i; } diff --git a/clang/test/Driver/clang-translation.c b/clang/test/Driver/clang-translation.c index 79d8f6f18ab0..2f02970a2a8e 100644 --- a/clang/test/Driver/clang-translation.c +++ b/clang/test/Driver/clang-translation.c @@ -4,7 +4,6 @@ // I386: "-disable-free" // I386: "-mrelocation-model" "static" // I386: "-mframe-pointer=all" -// I386: "-masm-verbose" // I386: "-munwind-tables" // I386: "-Os" // I386: "-fvisibility" diff --git a/clang/test/Driver/integrated-as.c b/clang/test/Driver/integrated-as.c index df5cf1a17ecc..170515579b1a 100644 --- a/clang/test/Driver/integrated-as.c +++ b/clang/test/Driver/integrated-as.c @@ -12,6 +12,7 @@ // NOFIAS-NOT: cc1as // NOFIAS: -cc1 +// NOFIAS: "-fno-verbose-asm" // NOFIAS: -no-integrated-as // RUN: %clang -target arm-linux-androideabi -### \ _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits