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

-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

llvm-svn: 331807
This commit is contained in:
Martin Storsjo 2018-05-08 20:55:23 +00:00
parent 635af6223b
commit f9fa17b873
2 changed files with 3 additions and 1 deletions

View 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");

View 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