This is an archive of the discontinued LLVM Phabricator instance.

Add a DWOId field to DICompileUnit (so DWARF skeleton CUs can be expression in IR).
ClosedPublic

Authored by aprantl on May 4 2015, 12:58 PM.

Details

Summary

This patch adds a DWOId field to DICompileUnit so DWARF skeleton CUs can be expression in IR.
A skeleton CU is a (typically empty) DW_TAG_compile_unit that has a DW_AT_(GNU)_dwo_name and a DW_AT_(GNU)_dwo_id attribute. It is used to refer to external debug info.

This is a prerequisite for clang module debugging as discussed in http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-November/040076.html.
In order to refer to external types stored in split DWARF (dwo) objects, such as clang modules, we need to emit skeleton CUs, which identify the dwarf object (i.e., the clang module) by filename (the SplitDebugFilename) and a hash value, the dwo_id.

This patch only contains the IR changes. The idea is that a CUs with a non-zero dwo_id field will be emitted together with a DW_AT_GNU_dwo_name and DW_AT_GNU_dwo_id attribute.

Diff Detail

Event Timeline

aprantl updated this revision to Diff 24899.May 4 2015, 12:58 PM
aprantl retitled this revision from to Add a DWOId field to DICompileUnit (so DWARF skeleton CUs can be expression in IR)..
aprantl updated this object.
aprantl edited the test plan for this revision. (Show Details)
aprantl added reviewers: dexonsmith, dblaikie, echristo.
aprantl set the repository for this revision to rL LLVM.
aprantl added a subscriber: Unknown Object (MLST).
dblaikie edited edge metadata.May 4 2015, 1:46 PM

And this is the part of the recent debug info schema changes that makes me
a bit sad - the amount of code that has to change to add a field to a debug
info record... that's a lot of files to touch, etc. :/

aprantl updated this revision to Diff 24921.May 4 2015, 4:00 PM
aprantl edited edge metadata.
aprantl removed rL LLVM as the repository for this revision.

Here's the requested autoupgrade code.

Duncan, is the ad-hoc fashion I implemented this the way to go, or is there a way to better separate the upgrades from the parser?
Also, is there a way to test the autoupgrade without checking in binary bitcode?

echristo edited edge metadata.May 4 2015, 4:01 PM

You can use llvm-as %s -o - | llvm-dis | FileCheck or something similar.

-eric

aprantl updated this revision to Diff 24927.May 4 2015, 5:17 PM
aprantl edited edge metadata.

Now with autoupgrade testcase.

aprantl updated this revision to Diff 24949.May 5 2015, 8:28 AM

Renamed testcase.

dblaikie accepted this revision.May 21 2015, 11:14 AM
dblaikie edited edge metadata.

Looks good. Sorry for the delay.

This revision is now accepted and ready to land.May 21 2015, 11:14 AM
aprantl closed this revision.Aug 18 2015, 10:37 AM

Closing. This was r237949.