Use an option alias to implement -gmlt

Review feedback from Reid Kleckner on r203603.

llvm-svn: 204755
This commit is contained in:
David Blaikie 2014-03-25 20:42:27 +00:00
parent 85093df3bd
commit f596145ac5
2 changed files with 2 additions and 4 deletions

View File

@ -898,8 +898,7 @@ def g_Flag : Flag<["-"], "g">, Group<g_Group>,
HelpText<"Generate source level debug information">, Flags<[CC1Option]>; HelpText<"Generate source level debug information">, Flags<[CC1Option]>;
def gline_tables_only : Flag<["-"], "gline-tables-only">, Group<g_Group>, def gline_tables_only : Flag<["-"], "gline-tables-only">, Group<g_Group>,
HelpText<"Emit debug line number tables only">, Flags<[CC1Option]>; HelpText<"Emit debug line number tables only">, Flags<[CC1Option]>;
def gmlt : Flag<["-"], "gmlt">, Group<g_Group>, def gmlt : Flag<["-"], "gmlt">, Alias<gline_tables_only>;
HelpText<"Emit debug line number tables only">, Flags<[DriverOption,HelpHidden]>;
def g0 : Flag<["-"], "g0">, Group<g_Group>; def g0 : Flag<["-"], "g0">, Group<g_Group>;
def g1 : Flag<["-"], "g1">, Group<g_Group>; def g1 : Flag<["-"], "g1">, Group<g_Group>;
def g2 : Flag<["-"], "g2">, Group<g_Group>; def g2 : Flag<["-"], "g2">, Group<g_Group>;

View File

@ -2695,8 +2695,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// are preserved, all other debug options are substituted with "-g". // are preserved, all other debug options are substituted with "-g".
Args.ClaimAllArgs(options::OPT_g_Group); Args.ClaimAllArgs(options::OPT_g_Group);
if (Arg *A = Args.getLastArg(options::OPT_g_Group)) { if (Arg *A = Args.getLastArg(options::OPT_g_Group)) {
if (A->getOption().matches(options::OPT_gline_tables_only) || if (A->getOption().matches(options::OPT_gline_tables_only)) {
A->getOption().matches(options::OPT_gmlt)) {
// FIXME: we should support specifying dwarf version with // FIXME: we should support specifying dwarf version with
// -gline-tables-only. // -gline-tables-only.
CmdArgs.push_back("-gline-tables-only"); CmdArgs.push_back("-gline-tables-only");