This is an archive of the discontinued LLVM Phabricator instance.

[DWARFv5] llvm-mc -dwarf-version does not imply -g.
ClosedPublic

Authored by probinson on Jun 11 2018, 3:01 PM.

Details

Summary

Don't provide the assembler source as the "root file" unless the user
asked to have debug info for the assembler source (with -g).

If the source doesn't provide an explicit ".file 0" then (a) use the
compilation directory as directory #0, and (b) use the file #1 info
for file #0 also.

Diff Detail

Repository
rL LLVM

Event Timeline

probinson created this revision.Jun 11 2018, 3:01 PM
aprantl accepted this revision.Jun 11 2018, 5:56 PM

So llvm-mc performs a literal translation by default and with -g it generates debug info for the assembler input? Seems reasonable.

llvm/lib/MC/MCDwarf.cpp
392 ↗(On Diff #150855)

Could this be a const StringRef &?

This revision is now accepted and ready to land.Jun 11 2018, 5:56 PM
probinson marked an inline comment as done.Jun 12 2018, 9:11 AM

So llvm-mc performs a literal translation by default and with -g it generates debug info for the assembler input? Seems reasonable.

Yes, that has been the behavior for some time, imitating the GNU assembler interface.
I stumbled over this while working on PR37623, and it was simpler to do this part first.

llvm/lib/MC/MCDwarf.cpp
392 ↗(On Diff #150855)

Indeed it can!

This revision was automatically updated to reflect the committed changes.
probinson marked an inline comment as done.