DebugInfo: Partial implementation of DWARF type units.

Emit DW_TAG_type_units into the debug_info section using compile unit
headers. This is bogus/unusable by debuggers, but testable and provides
more isolated review.

Subsequent patches will include support for type unit headers and
emission into the debug_types section, as well as comdat grouping the
types based on their hash. Also the CompileUnit type will be renamed
'Unit' and relevant portions pulled out into respective CompileUnit and
TypeUnit types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195166 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2013-11-19 23:08:21 +00:00
parent d4010998b0
commit 6fe6dc19f8
8 changed files with 151 additions and 54 deletions

View File

@ -92,10 +92,12 @@ void DIEHash::addParentContext(const DIE &Parent) {
// outermost such construct...
SmallVector<const DIE *, 1> Parents;
const DIE *Cur = &Parent;
while (Cur->getTag() != dwarf::DW_TAG_compile_unit) {
while (Cur->getParent()) {
Parents.push_back(Cur);
Cur = Cur->getParent();
}
assert(Cur->getTag() == dwarf::DW_TAG_compile_unit ||
Cur->getTag() == dwarf::DW_TAG_type_unit);
// Reverse iterate over our list to go from the outermost construct to the
// innermost.