From da08412bd068ba21ad898f79ab1d05d1e9a9c14e Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 28 Nov 2014 20:30:39 +0000 Subject: [PATCH] Fix a few memory leaks in CodeGenRegBank. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222930 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/CodeGenRegisters.cpp | 6 ++++++ utils/TableGen/CodeGenRegisters.h | 1 + 2 files changed, 7 insertions(+) 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; } -- 2.34.1