DIE() = delete;
explicit DIE(dwarf::Tag Tag) : Offset(0), Size(0), Tag(Tag) {}
-protected:
- void setUnit(DIEUnit *U) {
- Owner = U;
- }
public:
static DIE *get(BumpPtrAllocator &Alloc, dwarf::Tag Tag) {
return new (Alloc) DIE(Tag);
//===--------------------------------------------------------------------===//
/// Represents a compile or type unit.
class DIEUnit {
-protected:
/// The compile unit or type unit DIE. This variable must be an instance of
/// DIE so that we can calculate the DIEUnit from any DIE by traversing the
/// parent backchain and getting the Unit DIE, and then casting itself to a
: Die(UnitTag), Section(nullptr), Offset(0), Length(0), Version(V),
AddrSize(A)
{
- Die.setUnit(this);
+ Die.Owner = this;
assert((UnitTag == dwarf::DW_TAG_compile_unit ||
UnitTag == dwarf::DW_TAG_type_unit ||
UnitTag == dwarf::DW_TAG_partial_unit) && "expected a unit TAG");
const DICompileUnit *getCUNode() const { return CUNode; }
/// Return true if this compile unit has something to write out.
- bool hasContent() const { return Die.hasChildren(); }
+ bool hasContent() const { return getUnitDie().hasChildren(); }
/// Get string containing language specific context for a global name.
///