forked from OSchip/llvm-project
Insert composite type DIE into the map before processing type fields. This allows fields to find their context DIE from the map.
llvm-svn: 90498
This commit is contained in:
parent
fa23223d4a
commit
3b666fef67
|
@ -758,6 +758,7 @@ void DwarfDebug::addType(CompileUnit *DW_Unit, DIE *Entity, DIType Ty) {
|
||||||
|
|
||||||
// Construct type.
|
// Construct type.
|
||||||
DIE *Buffer = new DIE(dwarf::DW_TAG_base_type);
|
DIE *Buffer = new DIE(dwarf::DW_TAG_base_type);
|
||||||
|
ModuleCU->insertDIE(Ty.getNode(), Buffer);
|
||||||
if (Ty.isBasicType())
|
if (Ty.isBasicType())
|
||||||
constructTypeDIE(DW_Unit, *Buffer, DIBasicType(Ty.getNode()));
|
constructTypeDIE(DW_Unit, *Buffer, DIBasicType(Ty.getNode()));
|
||||||
else if (Ty.isCompositeType())
|
else if (Ty.isCompositeType())
|
||||||
|
@ -779,7 +780,6 @@ void DwarfDebug::addType(CompileUnit *DW_Unit, DIE *Entity, DIType Ty) {
|
||||||
DW_Unit->addDie(Buffer);
|
DW_Unit->addDie(Buffer);
|
||||||
Entry->setEntry(Buffer);
|
Entry->setEntry(Buffer);
|
||||||
Entity->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, Entry);
|
Entity->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, Entry);
|
||||||
ModuleCU->insertDIE(Ty.getNode(), Buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// constructTypeDIE - Construct basic type die from DIBasicType.
|
/// constructTypeDIE - Construct basic type die from DIBasicType.
|
||||||
|
|
Loading…
Reference in New Issue