r199535 - Driver support for -fdebug-types-sections
David Blaikie
dblaikie at gmail.com
Fri Jan 17 18:02:06 PST 2014
Author: dblaikie
Date: Fri Jan 17 20:02:06 2014
New Revision: 199535
URL: http://llvm.org/viewvc/llvm-project?rev=199535&view=rev
Log:
Driver support for -fdebug-types-sections
Using backend-option like a few other debug codegen flags. I believe
Eric Christopher's working at porting those over to something nicer
such as an API level CodeGenOptions or the like, so this can be
improved along with that work.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/debug-options.c
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=199535&r1=199534&r2=199535&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Jan 17 20:02:06 2014
@@ -2599,7 +2599,10 @@ void Clang::ConstructJob(Compilation &C,
CmdArgs.push_back("-generate-gnu-dwarf-pub-sections");
}
- Args.AddAllArgs(CmdArgs, options::OPT_fdebug_types_section);
+ if (Args.hasArg(options::OPT_fdebug_types_section)) {
+ CmdArgs.push_back("-backend-option");
+ CmdArgs.push_back("-generate-type-units");
+ }
Args.AddAllArgs(CmdArgs, options::OPT_ffunction_sections);
Args.AddAllArgs(CmdArgs, options::OPT_fdata_sections);
Modified: cfe/trunk/test/Driver/debug-options.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/debug-options.c?rev=199535&r1=199534&r2=199535&view=diff
==============================================================================
--- cfe/trunk/test/Driver/debug-options.c (original)
+++ cfe/trunk/test/Driver/debug-options.c Fri Jan 17 20:02:06 2014
@@ -45,12 +45,14 @@
// RUN: | FileCheck -check-prefix=GLTO_NO %s
//
// RUN: %clang -### -c -grecord-gcc-switches -gno-record-gcc-switches \
-// RUN: -gstrict-dwarf -gno-strict-dwarf -fdebug-types-section \
-// RUN: -fno-debug-types-section %s 2>&1 \
+// RUN: -gstrict-dwarf -gno-strict-dwarf %s 2>&1 \
// RUN: | FileCheck -check-prefix=GIGNORE %s
//
// RUN: %clang -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GOPT %s
//
+// RUN: %clang -### -fdebug-types-section %s 2>&1 \
+// RUN: | FileCheck -check-prefix=FDTS %s
+//
// G: "-cc1"
// G: "-g"
//
@@ -90,3 +92,5 @@
// GIGNORE-NOT: "argument unused during compilation"
//
// GOPT: -generate-gnu-dwarf-pub-sections
+//
+// FDTS: "-backend-option" "-generate-type-units"
More information about the cfe-commits
mailing list