This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Add a getParent method to DWARFDebugInformationEntryMinimal.
Needs ReviewPublic

Authored by friss on Jan 16 2015, 4:16 PM.

Details

Reviewers
dblaikie
samsonov
Summary

The DIE representation of libDebugInfo is designed to be minimal
(as the class name implies). The information that's there allows
to walk the DIE tree down, but you can't get back to the root
from an arbitrary node.

This patch adds this ability with the goal of using it in
llvm-dsymutil. I could also use this information in dwarfdump
itself to easily support dumping the full DIE hierarchy of a
selected DIE when I finally implement a search option.

The added information definitely has a cost: the size of
the structure is increased by 8 bytes on 64 bits archs
due to padding and this combined to the added logic makes
the raw parsing between 5 and 10% slower.

Just for llvm-dsymutil, this is optional. I can gather the
parent chains in a separate path and store them, but I think
that the performance/aded functionality benefit is worth
it. WDYT?

Diff Detail

Event Timeline

friss updated this revision to Diff 18328.Jan 16 2015, 4:16 PM
friss retitled this revision from to [DebugInfo] Add a getParent method to DWARFDebugInformationEntryMinimal..
friss updated this object.
friss edited the test plan for this revision. (Show Details)
friss added reviewers: samsonov, dblaikie.
friss added a subscriber: Unknown Object (MLST).