From: David Blaikie Date: Mon, 27 Jan 2014 18:52:43 +0000 (+0000) Subject: Driver: support -fno-debug-types-section to override -fdebug-types-section X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19771c74b54885ff4a646998b2ab613d78b17ef0;p=clang Driver: support -fno-debug-types-section to override -fdebug-types-section git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200236 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 25a1d12848..6b7e198d0b 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -873,6 +873,8 @@ def fno_data_sections : Flag <["-"], "fno-data-sections">, Group, Flags<[CC1Option]>; def fdebug_types_section: Flag <["-"], "fdebug-types-section">, Group, Flags<[CC1Option]>, HelpText<"Place debug types in their own section (ELF Only)">; +def fno_debug_types_section: Flag<["-"], "fno-debug-types-section">, Group, + Flags<[CC1Option]>; def g_Flag : Flag<["-"], "g">, Group, HelpText<"Generate source level debug information">, Flags<[CC1Option]>; def gline_tables_only : Flag<["-"], "gline-tables-only">, Group, diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 3176f1f3c4..615c3758d6 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -2606,7 +2606,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-generate-gnu-dwarf-pub-sections"); } - if (Args.hasArg(options::OPT_fdebug_types_section)) { + if (Args.hasFlag(options::OPT_fdebug_types_section, + options::OPT_fno_debug_types_section, false)) { CmdArgs.push_back("-backend-option"); CmdArgs.push_back("-generate-type-units"); } diff --git a/test/Driver/debug-options.c b/test/Driver/debug-options.c index 65350a67f9..e17cc01d60 100644 --- a/test/Driver/debug-options.c +++ b/test/Driver/debug-options.c @@ -53,6 +53,10 @@ // RUN: %clang -### -fdebug-types-section %s 2>&1 \ // RUN: | FileCheck -check-prefix=FDTS %s // +// RUN: %clang -### -fdebug-types-section -fno-debug-types-section %s 2>&1 \ +// RUN: | FileCheck -check-prefix=NOFDTS %s +// +// // G: "-cc1" // G: "-g" // @@ -94,3 +98,5 @@ // GOPT: -generate-gnu-dwarf-pub-sections // // FDTS: "-backend-option" "-generate-type-units" +// +// NOFDTS-NOT: "-backend-option" "-generate-type-units"