diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-04-22 21:27:37 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-04-22 21:27:37 +0000 |
commit | c33b3cdb0c1f47dd143415400d303cf642c358da (patch) | |
tree | fda5a9dee0874bb30d94a8e34e74e76710088cc6 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | |
parent | b344224949c3de170b9e21be97deba32b72a7f67 (diff) | |
download | bcm5719-llvm-c33b3cdb0c1f47dd143415400d303cf642c358da.tar.gz bcm5719-llvm-c33b3cdb0c1f47dd143415400d303cf642c358da.zip |
Use std::unique_ptr to handle ownership of DwarfUnits in DwarfFile.
So Chandler - how about those range algorithms? (would really love a
dereferencing range adapter for this sort of stuff)
llvm-svn: 206921
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index 363d7650e0b..521a62310ae 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -145,7 +145,7 @@ class DwarfFile { std::vector<DIEAbbrev *> Abbreviations; // A pointer to all units in the section. - SmallVector<DwarfUnit *, 1> CUs; + SmallVector<std::unique_ptr<DwarfUnit>, 1> CUs; // Collection of strings for this unit and assorted symbols. // A String->Symbol mapping of strings used by indirect @@ -168,12 +168,11 @@ class DwarfFile { AddrPool AddressPool; public: - DwarfFile(AsmPrinter *AP, const char *Pref, BumpPtrAllocator &DA) - : Asm(AP), StringPool(DA), NextStringPoolNumber(0), StringPref(Pref) {} + DwarfFile(AsmPrinter *AP, const char *Pref, BumpPtrAllocator &DA); ~DwarfFile(); - const SmallVectorImpl<DwarfUnit *> &getUnits() { return CUs; } + const SmallVectorImpl<std::unique_ptr<DwarfUnit>> &getUnits() { return CUs; } /// \brief Compute the size and offset of a DIE given an incoming Offset. unsigned computeSizeAndOffset(DIE &Die, unsigned Offset); @@ -185,7 +184,7 @@ public: void assignAbbrevNumber(DIEAbbrev &Abbrev); /// \brief Add a unit to the list of CUs. - void addUnit(DwarfUnit *CU) { CUs.push_back(CU); } + void addUnit(DwarfUnit *CU); /// \brief Emit all of the units to the section listed with the given /// abbreviation section. @@ -413,7 +412,7 @@ class DwarfDebug : public AsmPrinterHandler { void addScopeVariable(LexicalScope *LS, DbgVariable *Var); - const SmallVectorImpl<DwarfUnit *> &getUnits() { + const SmallVectorImpl<std::unique_ptr<DwarfUnit>> &getUnits() { return InfoHolder.getUnits(); } |