diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp index 2f175d46e183..6a32ab62d403 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp @@ -42,6 +42,11 @@ DwarfAccelTable::DwarfAccelTable(DwarfAccelTable::Atom atom) : HeaderData(atom) { } +DwarfAccelTable::~DwarfAccelTable() { + for (size_t i = 0 ; i < Data.size(); ++i) + delete Data[i]; +} + void DwarfAccelTable::AddName(StringRef Name, DIE* die) { // If the string is in the list already then add this die to the list // otherwise add a new one. diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h b/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h index 2d3f4fd946d3..4fc6118274e3 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h @@ -239,6 +239,7 @@ public: // Public Implementation public: DwarfAccelTable(DwarfAccelTable::Atom Atom); + ~DwarfAccelTable(); void AddName(StringRef, DIE*); void FinalizeTable(AsmPrinter *, const char *); void Emit(AsmPrinter *, MCSymbol *, DwarfDebug *);