1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00

Add type DIE into appropriate context DIE.

llvm-svn: 63154
This commit is contained in:
Devang Patel 2009-01-27 23:22:55 +00:00
parent 718c678fde
commit 031a8a1ef5

View File

@ -1687,9 +1687,23 @@ private:
ConstructTypeDIE(DW_Unit, Buffer, DICompositeType(Ty.getGV())); ConstructTypeDIE(DW_Unit, Buffer, DICompositeType(Ty.getGV()));
} }
// Add debug information entry to entity and unit. // Add debug information entry to entity and appropriate context.
DIE *Die = DW_Unit->AddDie(Buffer); DIE *Die = NULL;
SetDIEntry(Slot, Die); DIDescriptor Context = Ty.getContext();
if (!Context.isNull())
Die = DW_Unit->getDieMapSlotFor(Context.getGV());
if (Die) {
DIE *Child = new DIE(Buffer);
Die->AddChild(Child);
Buffer.Detach();
SetDIEntry(Slot, Child);
}
else {
Die = DW_Unit->AddDie(Buffer);
SetDIEntry(Slot, Die);
}
Entity->AddValue(DW_AT_type, DW_FORM_ref4, Slot); Entity->AddValue(DW_AT_type, DW_FORM_ref4, Slot);
} }