This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Emit DWARF reference for DIVariable 'count' in DISubrange
ClosedPublic

Authored by sdesmalen on Jan 3 2018, 3:03 AM.

Details

Summary

This patch implements the codegen of DWARF debug info for non-constant
'count' fields for DISubrange.

This is patch [2/3] in a series to extend LLVM's DISubrange Metadata
node to support debugging of C99 variable length arrays and vectors with
runtime length like the Scalable Vector Extension for AArch64. It is
also a first step towards representing more complex cases like arrays
in Fortran.

Diff Detail

Event Timeline

sdesmalen created this revision.Jan 3 2018, 3:03 AM
fhahn added a subscriber: fhahn.Jan 3 2018, 3:09 AM
sdesmalen updated this revision to Diff 130432.Jan 18 2018, 9:57 AM

Updated patch to use new interface for 'getCountVariableOrNull()'.

sdesmalen updated this revision to Diff 131064.Jan 23 2018, 7:10 AM

Adjusted to use new interface for getCount()

aprantl accepted this revision.Jan 23 2018, 8:26 AM
aprantl added inline comments.
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
1316

remove everything up until (and including) "since".

test/DebugInfo/Generic/disubrange.ll
5

For documentation, could you CHECK the TAG_variable first and also CHECK for its name?

This revision is now accepted and ready to land.Jan 23 2018, 8:26 AM
This revision was automatically updated to reflect the committed changes.
sdesmalen marked 2 inline comments as done.Jan 24 2018, 5:39 AM
sdesmalen added inline comments.
test/DebugInfo/Generic/disubrange.ll
5

I've done this by running llvm-dwarfdump once with -name=vla_expr to get the debug entry, and then a second llvm-dwarfdump cross references this entry with the value used for the count field. (this was needed because the DW_AT_name is on the next line after DW_TAG_variable).

That's great. We should take advantage of the new dwarfdump features.