[PATCH] D46287: [Driver] Don't add -dwarf-column-info when using -gcodeview on non-msvc targets

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 30 13:50:52 PDT 2018


mstorsjo created this revision.
mstorsjo added reviewers: zturner, rnk, smeenai.
Herald added subscribers: JDevlieghere, aprantl.

-dwarf-column-info is omitted if -gcodeview is specified for msvc targets at the moment, but since -gcodeview is an option that can be specified for any target, there's little reason to restrict this handling to msvc targets.

This allows getting proper codeview debug info by passing -gcodeview for e.g. MinGW targets as well.


Repository:
  rC Clang

https://reviews.llvm.org/D46287

Files:
  lib/Driver/ToolChains/Clang.cpp
  test/Driver/codeview-column-info.c


Index: test/Driver/codeview-column-info.c
===================================================================
--- test/Driver/codeview-column-info.c
+++ test/Driver/codeview-column-info.c
@@ -6,6 +6,8 @@
 // RUN: FileCheck < %t1 %s
 // RUN: %clangxx -### --target=x86_64-windows-msvc -c -g -gcodeview %s 2> %t2
 // RUN: FileCheck < %t2 %s
+// RUN: %clangxx -### --target=x86_64-windows-gnu -c -g -gcodeview %s 2> %t2
+// RUN: FileCheck < %t2 %s
 // RUN: %clang_cl -### --target=x86_64-windows-msvc /c /Z7 -- %s 2> %t2
 // RUN: FileCheck < %t2 %s
 
Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -2991,7 +2991,7 @@
   // debuggers don't handle missing end columns well, so it's better not to
   // include any column info.
   if (Args.hasFlag(options::OPT_gcolumn_info, options::OPT_gno_column_info,
-                   /*Default=*/!(IsWindowsMSVC && EmitCodeView) &&
+                   /*Default=*/!EmitCodeView &&
                        DebuggerTuning != llvm::DebuggerKind::SCE))
     CmdArgs.push_back("-dwarf-column-info");
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46287.144630.patch
Type: text/x-patch
Size: 1167 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180430/ee8ce3ae/attachment.bin>


More information about the cfe-commits mailing list