This is an archive of the discontinued LLVM Phabricator instance.

[codeview] Make "clang -g" emit codeview by default when targetting MSVC
ClosedPublic

Authored by rnk on Nov 13 2018, 3:23 PM.

Details

Summary

If you're using the Microsoft ABI, chances are that you want PDBs and
codeview debug info. Currently, everyone has to remember to specific
-gcodeview by default, when it would be nice if the standard -g option
did the right thing by default.

Also, do some related cleanup of -cc1 options. When targetting the MS
C++ ABI, we probably shouldn't pass -debugger-tuning=gdb. We were also
passing -gcodeview twice, which is silly.

Diff Detail

Repository
rC Clang

Event Timeline

rnk created this revision.Nov 13 2018, 3:23 PM
smeenai accepted this revision.Nov 13 2018, 4:32 PM

LGTM, though you may wanna also wait for Zach.

clang/test/CodeGen/dwarf-version.c
33 ↗(On Diff #173948)

Is it worth adding a test for a non msvc target to ensure the default for -g is still DWARF?

This revision is now accepted and ready to land.Nov 13 2018, 4:32 PM
zturner accepted this revision.Nov 13 2018, 4:34 PM
rnk added inline comments.Nov 13 2018, 5:27 PM
clang/test/CodeGen/dwarf-version.c
33 ↗(On Diff #173948)

Yeah, let's do it. It's covered elsewhere, but encoding it here as intentional is good.

This revision was automatically updated to reflect the committed changes.