]> granicus.if.org Git - clang/commitdiff
[Driver] Don't add -dwarf-column-info when using -gcodeview on non-msvc targets
authorMartin Storsjo <martin@martin.st>
Tue, 8 May 2018 20:55:23 +0000 (20:55 +0000)
committerMartin Storsjo <martin@martin.st>
Tue, 8 May 2018 20:55:23 +0000 (20:55 +0000)
-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.

Differential Revision: https://reviews.llvm.org/D46287

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

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

index 352ffc81d6d180190cfdf12b166b08e6fc98bf70..762b5bdcdfb9d7141c4ef0b593cd591aa2db1198 100644 (file)
@@ -3000,7 +3000,7 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
   // 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");
 
index c5a7dc96d4118b4cc87f66ab5edd846aa39e79eb..6b524accd7b7082f8735620e6ba6fd7dbcfb9b83 100644 (file)
@@ -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