r203603 - Driver: Support -gmlt as an alias for -gline-tables-only

David Blaikie dblaikie at gmail.com
Tue Mar 25 13:48:59 PDT 2014


On Tue, Mar 25, 2014 at 1:39 PM, Reid Kleckner <rnk at google.com> wrote:
> On Tue, Mar 11, 2014 at 2:05 PM, David Blaikie <dblaikie at gmail.com> wrote:
>>
>> Author: dblaikie
>> Date: Tue Mar 11 16:05:26 2014
>> New Revision: 203603
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=203603&view=rev
>> Log:
>> Driver: Support -gmlt as an alias for -gline-tables-only
>>
>> Modified:
>>     cfe/trunk/include/clang/Driver/Options.td
>>     cfe/trunk/lib/Driver/Tools.cpp
>>     cfe/trunk/test/Driver/debug-options.c
>>
>> Modified: cfe/trunk/include/clang/Driver/Options.td
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=203603&r1=203602&r2=203603&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/include/clang/Driver/Options.td (original)
>> +++ cfe/trunk/include/clang/Driver/Options.td Tue Mar 11 16:05:26 2014
>> @@ -900,6 +900,8 @@ def g_Flag : Flag<["-"], "g">, Group<g_G
>>    HelpText<"Generate source level debug information">,
>> Flags<[CC1Option]>;
>>  def gline_tables_only : Flag<["-"], "gline-tables-only">, Group<g_Group>,
>>    HelpText<"Emit debug line number tables only">, Flags<[CC1Option]>;
>> +def gmlt : Flag<["-"], "gmlt">, Group<g_Group>,
>> +  HelpText<"Emit debug line number tables only">,
>> Flags<[DriverOption,HelpHidden]>;
>
>
> Why not just:
> def gmlt : Flag<["-"], "gmlt">, Alias<gline_tables_only>;

Because I didn't know our option tablegen had an Alias feature...
Thanks for the suggestion!

Implemented in r204755.

>
>>
>>  def g0 : Flag<["-"], "g0">, Group<g_Group>;
>>  def g1 : Flag<["-"], "g1">, Group<g_Group>;
>>  def g2 : Flag<["-"], "g2">, Group<g_Group>;
>>
>> Modified: cfe/trunk/lib/Driver/Tools.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=203603&r1=203602&r2=203603&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/lib/Driver/Tools.cpp (original)
>> +++ cfe/trunk/lib/Driver/Tools.cpp Tue Mar 11 16:05:26 2014
>> @@ -2693,7 +2693,8 @@ void Clang::ConstructJob(Compilation &C,
>>    // are preserved, all other debug options are substituted with "-g".
>>    Args.ClaimAllArgs(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
>>        // -gline-tables-only.
>>        CmdArgs.push_back("-gline-tables-only");
>>
>> Modified: cfe/trunk/test/Driver/debug-options.c
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/debug-options.c?rev=203603&r1=203602&r2=203603&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/test/Driver/debug-options.c (original)
>> +++ cfe/trunk/test/Driver/debug-options.c Tue Mar 11 16:05:26 2014
>> @@ -33,6 +33,8 @@
>>  // RUN: %clang -### -c -g -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
>>  // RUN: %clang -### -c -ggdb0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
>>  //
>> +// RUN: %clang -### -c -gmlt %s 2>&1 \
>> +// RUN:             | FileCheck -check-prefix=GLTO_ONLY %s
>>  // RUN: %clang -### -c -gline-tables-only %s 2>&1 \
>>  // RUN:             | FileCheck -check-prefix=GLTO_ONLY %s
>>  // RUN: %clang -### -c -gline-tables-only %s -target x86_64-apple-darwin
>> 2>&1 \
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>



More information about the cfe-commits mailing list