This is an archive of the discontinued LLVM Phabricator instance.

[COFF, ARM64, CodeView] Add support to emit CodeView debug info for ARM64 COFF
ClosedPublic

Authored by mgrang on Jul 17 2017, 4:34 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

mgrang created this revision.Jul 17 2017, 4:34 PM
ruiu added inline comments.Jul 17 2017, 4:36 PM
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
307–308 ↗(On Diff #106975)

Please fix style.

I have a related question: Does it make sense to make -gcodeview the default for Windows COFF targets (both arm/arm64)? ie: clang would internally add -gcodeview if -g is passed.

mgrang updated this revision to Diff 106977.Jul 17 2017, 4:43 PM

Addressed comment.

mgrang marked an inline comment as done.Jul 17 2017, 4:43 PM
rnk added inline comments.Jul 17 2017, 4:47 PM
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
307–308 ↗(On Diff #106975)

The old way of doing this supported emitting both dwarf and CV, which we briefly considered to be interesting. There isn't any real use case for it, but I think I'd prefer it if these things were independent. We shouldn't have a dwarf version flag if the frontend wants us to emit codeview.

>> The old way of doing this supported emitting both dwarf and CV, which we briefly considered to be interesting. There isn't any real use case for it, but I think I'd prefer it if these things were independent. We shouldn't have a dwarf version flag if the frontend wants us to emit codeview.

@rnk So you mean adding an "else if" here is fine or should I revert this to the old way?

majnemer added inline comments.
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
307 ↗(On Diff #106977)

Hrm, why isn't this just if (MMI->getModule()->getDwarfVersion()) ?

mgrang added inline comments.Jul 18 2017, 11:07 AM
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
307 ↗(On Diff #106977)

In order to emit CodeView info for COFF, we need to pass -g -gcodeview. I wanted to make this an else-if since otherwise it will always emit Dwarf info as well (due to the presence of -g).

rnk added inline comments.Jul 19 2017, 2:33 PM
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
307 ↗(On Diff #106977)

I don't think that'll happen, I don't see any "Dwarf Version" metadata when I run clang -S -emit-llvm -g -gcodeview t.c -o -.

mgrang updated this revision to Diff 107570.Jul 20 2017, 12:46 PM

Reverted the change in AsmPrinter.cpp.

rnk accepted this revision.Jul 20 2017, 12:58 PM

lgtm

This revision is now accepted and ready to land.Jul 20 2017, 12:58 PM
This revision was automatically updated to reflect the committed changes.