Author: hfinkel Date: Tue Oct 21 14:20:21 2014 New Revision: 220311 URL: http://llvm.org/viewvc/llvm-project?rev=220311&view=rev Log: Treat -g1 as -gline-tables-only
-g1 on gcc (and also IBM's xlc) are documented to be very similar to -gline-tables-only. Our -gline-tables-only might still be more verbose than -g1 on other compilers, but currently we treat -g1 as -g, and so we're producing much more debug info at -g1 than everybody else. Treating -g1 as -gline-tables-only brings us much closer to what everyone else is doing. For more information, see the discussion on http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-October/039649.html 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=220311&r1=220310&r2=220311&view=diff ============================================================================== --- cfe/trunk/lib/Driver/Tools.cpp (original) +++ cfe/trunk/lib/Driver/Tools.cpp Tue Oct 21 14:20:21 2014 @@ -3146,7 +3146,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_g1)) { // 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=220311&r1=220310&r2=220311&view=diff ============================================================================== --- cfe/trunk/test/Driver/debug-options.c (original) +++ cfe/trunk/test/Driver/debug-options.c Tue Oct 21 14:20:21 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 -g1 %s 2>&1 \ +// RUN: | FileCheck -check-prefix=GLTO_ONLY %s // RUN: %clang -### -c -gmlt %s 2>&1 \ // RUN: | FileCheck -check-prefix=GLTO_ONLY %s // RUN: %clang -### -c -gline-tables-only %s 2>&1 \ _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
