diff --git a/utils/TableGen/CodeGenRegisters.cpp b/utils/TableGen/CodeGenRegisters.cpp index 678222f315e..e839423f604 100644 --- a/utils/TableGen/CodeGenRegisters.cpp +++ b/utils/TableGen/CodeGenRegisters.cpp @@ -1012,6 +1012,12 @@ CodeGenRegBank::CodeGenRegBank(RecordKeeper &Records) { CodeGenRegisterClass::computeSubClasses(*this); } +CodeGenRegBank::~CodeGenRegBank() { + DeleteContainerPointers(SubRegIndices); + DeleteContainerPointers(Registers); + DeleteContainerPointers(RegClasses); +} + // Create a synthetic CodeGenSubRegIndex without a corresponding Record. CodeGenSubRegIndex* CodeGenRegBank::createSubRegIndex(StringRef Name, StringRef Namespace) { diff --git a/utils/TableGen/CodeGenRegisters.h b/utils/TableGen/CodeGenRegisters.h index c1e37fae076..53568c17ca8 100644 --- a/utils/TableGen/CodeGenRegisters.h +++ b/utils/TableGen/CodeGenRegisters.h @@ -521,6 +521,7 @@ namespace llvm { public: CodeGenRegBank(RecordKeeper&); + ~CodeGenRegBank(); SetTheory &getSets() { return Sets; }