This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Support DWARFv5 source code embedding extension
ClosedPublic

Authored by scott.linder on Jan 31 2018, 1:59 PM.

Details

Summary

In DWARFv5 the Line Number Program Header is extensible, allowing values
with new content types. In this extension source is embedded directly
in the line tables of the DWARFv5 line debug section.

Add new flag (-g[no-]embed-source) to Driver and CC1 which indicates
that source should be passed through to LLVM during CodeGen.

Depends on LLVM review https://reviews.llvm.org/D42765

Diff Detail

Event Timeline

scott.linder created this revision.Jan 31 2018, 1:59 PM

With https://reviews.llvm.org/D42765 committed I think this is ready for review.

Looks generally straightforward. I'd give other people a chance to chime in but I have only minor comments.

lib/CodeGen/CGDebugInfo.cpp
411

Looks like this simplification (replace two calls to createFile() with getOrCreateMainFile()) could be its own NFC commit and simplify this patch slightly.

lib/Driver/ToolChains/Clang.cpp
3021

Maybe "is an extension to DWARF v5" to clarify it's not actually part of DWARF v5.

nhaehnle removed a subscriber: nhaehnle.Feb 25 2018, 7:33 AM

New diff addresses feedback. I committed the refactoring as NFC and rebased, then clarified the extension comment.

scott.linder marked 2 inline comments as done.Feb 26 2018, 8:42 AM
This revision is now accepted and ready to land.Feb 26 2018, 8:51 AM
This revision was automatically updated to reflect the committed changes.