DwarfUnit: Provide a reference to a defining DwarfCompileUnit from DwarfTypeUnit.

Type units need to insert their file strings into the compile unit's
line/file table. This is preliminary work to that end.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201196 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2014-02-12 00:31:30 +00:00
parent a22a1bb8c1
commit c6c93e96e9
4 changed files with 26 additions and 14 deletions

View File

@ -55,9 +55,11 @@ DwarfCompileUnit::DwarfCompileUnit(unsigned UID, DIE *D, DICompileUnit Node,
insertDIE(Node, D);
}
DwarfTypeUnit::DwarfTypeUnit(unsigned UID, DIE *D, DICompileUnit CUNode,
DwarfTypeUnit::DwarfTypeUnit(unsigned UID, DIE *D, DwarfCompileUnit &CU,
AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
: DwarfUnit(UID, D, CUNode, A, DW, DWU) {}
: DwarfUnit(UID, D, CU.getCUNode(), A, DW, DWU), CU(CU) {
(void)CU;
}
/// ~Unit - Destructor for compile unit.
DwarfUnit::~DwarfUnit() {
@ -944,7 +946,7 @@ DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
DICompositeType CTy(Ty);
if (GenerateDwarfTypeUnits && !Ty.isForwardDecl())
if (MDString *TypeId = CTy.getIdentifier()) {
DD->addDwarfTypeUnitType(getCUNode(), TypeId->getString(), TyDIE, CTy);
DD->addDwarfTypeUnitType(getCU(), TypeId->getString(), TyDIE, CTy);
// Skip updating the accellerator tables since this is not the full type
return TyDIE;
}