unsigned getUniqueID() const { return UniqueID; }
uint16_t getLanguage() const { return CUNode.getLanguage(); }
DICompileUnit getCUNode() const { return CUNode; }
- DIE *getUnitDie() const { return UnitDie.get(); }
+ DIE &getUnitDie() const { return *UnitDie; }
const StringMap<const DIE *> &getGlobalNames() const { return GlobalNames; }
const StringMap<const DIE *> &getGlobalTypes() const { return GlobalTypes; }
/// kept in DwarfDebug.
void insertDIE(DIDescriptor Desc, DIE *D);
- /// addDie - Adds or interns the DIE to the compile unit.
- ///
- void addDie(DIE *Buffer) { UnitDie->addChild(Buffer); }
-
/// addFlag - Add a flag that is true to the DIE.
void addFlag(DIE &Die, dwarf::Attribute Attribute);
const MCSymbol *Lo);
/// addDIEEntry - Add a DIE attribute data and value.
- void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE *Entry);
+ void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE &Entry);
/// addDIEEntry - Add a DIE attribute data and value.
void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIEEntry *Entry);
void constructContainingTypeDIEs();
/// constructVariableDIE - Construct a DIE for the given DbgVariable.
- DIE *constructVariableDIE(DbgVariable &DV, bool isScopeAbstract);
+ std::unique_ptr<DIE> constructVariableDIE(DbgVariable &DV,
+ bool isScopeAbstract);
/// constructSubprogramArguments - Construct function argument DIEs.
void constructSubprogramArguments(DIE &Buffer, DIArray Args);
/// Create a DIE with the given Tag, add the DIE to its parent, and
/// call insertDIE if MD is not null.
- DIE *createAndAddDIE(unsigned Tag, DIE &Parent,
+ DIE &createAndAddDIE(unsigned Tag, DIE &Parent,
DIDescriptor N = DIDescriptor());
/// Compute the size of a header for this unit, not including the initial
virtual DwarfCompileUnit &getCU() = 0;
+ /// constructTypeDIE - Construct type DIE from DICompositeType.
+ void constructTypeDIE(DIE &Buffer, DICompositeType CTy);
+
protected:
/// getOrCreateStaticMemberDIE - Create new static data member DIE.
DIE *getOrCreateStaticMemberDIE(DIDerivedType DT);
private:
/// \brief Construct a DIE for the given DbgVariable without initializing the
/// DbgVariable's DIE reference.
- DIE *constructVariableDIEImpl(const DbgVariable &DV, bool isScopeAbstract);
+ std::unique_ptr<DIE> constructVariableDIEImpl(const DbgVariable &DV,
+ bool isScopeAbstract);
/// constructTypeDIE - Construct basic type die from DIBasicType.
void constructTypeDIE(DIE &Buffer, DIBasicType BTy);
/// constructTypeDIE - Construct derived type die from DIDerivedType.
void constructTypeDIE(DIE &Buffer, DIDerivedType DTy);
- /// constructTypeDIE - Construct type DIE from DICompositeType.
- void constructTypeDIE(DIE &Buffer, DICompositeType CTy);
-
/// constructSubrangeDIE - Construct subrange DIE from DISubrange.
void constructSubrangeDIE(DIE &Buffer, DISubrange SR, DIE *IndexTy);
/// createDIEEntry - Creates a new DIEEntry to be a proxy for a debug
/// information entry.
- DIEEntry *createDIEEntry(DIE *Entry);
+ DIEEntry *createDIEEntry(DIE &Entry);
/// resolve - Look in the DwarfDebug map for the MDNode that
/// corresponds to the reference.
/// If this is a named finished type then include it in the list of types for
/// the accelerator tables.
- void updateAcceleratorTables(DIScope Context, DIType Ty, const DIE *TyDIE);
+ void updateAcceleratorTables(DIScope Context, DIType Ty, const DIE &TyDIE);
};
class DwarfCompileUnit : public DwarfUnit {