bool InDebugMap; ///< Was this DIE's entity found in the map?
};
- CompileUnit(DWARFUnit &OrigUnit)
- : OrigUnit(OrigUnit), LowPc(UINT64_MAX), HighPc(0), RangeAlloc(),
+ CompileUnit(DWARFUnit &OrigUnit, unsigned ID)
+ : OrigUnit(OrigUnit), ID(ID), LowPc(UINT64_MAX), HighPc(0), RangeAlloc(),
Ranges(RangeAlloc), UnitRangeAttribute(nullptr) {
Info.resize(OrigUnit.getNumDIEs());
}
DWARFUnit &getOrigUnit() const { return OrigUnit; }
+ unsigned getUniqueID() const { return ID; }
+
DIE *getOutputUnitDIE() const { return CUDie.get(); }
void setOutputUnitDIE(DIE *Die) { CUDie.reset(Die); }
private:
DWARFUnit &OrigUnit;
+ unsigned ID;
std::vector<DIEInfo> Info; ///< DIE info indexed by DIE index.
std::unique_ptr<DIE> CUDie; ///< Root of the linked DIE tree.
// Size of the DIEs (and headers) generated for the linked output.
uint64_t OutputDebugInfoSize = 0;
-
+ // A unique ID that identifies each compile unit.
+ unsigned UnitID = 0;
for (const auto &Obj : Map.objects()) {
CurrentDebugObject = Obj.get();
outs() << "Input compilation unit:";
CUDie->dump(outs(), CU.get(), 0);
}
- Units.emplace_back(*CU);
+ Units.emplace_back(*CU, UnitID++);
gatherDIEParents(CUDie, 0, Units.back());
}