]> granicus.if.org Git - clang/commitdiff
Treat -g1 as -gline-tables-only
authorHal Finkel <hfinkel@anl.gov>
Tue, 21 Oct 2014 19:20:21 +0000 (19:20 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 21 Oct 2014 19:20:21 +0000 (19:20 +0000)
-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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220311 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/debug-options.c

index 151400cbc48ad7bf37a9d53f97c7344b627b2eed..822d55b7cbfd98caf6d8c63520022a06bf17f8a7 100644 (file)
@@ -3146,7 +3146,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   // 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");
index 80a01d48e8c20b3b575c49fe2ab1ccc1273c43ef..50461798efd0a24a03403766669561835c7642ed 100644 (file)
@@ -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 \