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.

llvm-svn: 199535
This commit is contained in:
David Blaikie 2014-01-18 02:02:06 +00:00
parent 6826d22784
commit d74be70aba
2 changed files with 10 additions and 3 deletions

View File

@ -2599,7 +2599,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
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);

View File

@ -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"