[TableGen] Fix all remaining memory leaks of Init and RecTy objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235696 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper
2015-04-24 05:38:48 +00:00
parent 728ad0157c
commit 7cc4f07bdc
2 changed files with 39 additions and 35 deletions

View File

@@ -81,7 +81,7 @@ public:
private:
RecTyKind Kind;
ListRecTy *ListTy;
std::unique_ptr<ListRecTy> ListTy;
virtual void anchor();
public:
@@ -566,6 +566,11 @@ class TypedInit : public Init {
protected:
explicit TypedInit(InitKind K, RecTy *T) : Init(K), Ty(T) {}
~TypedInit() {
// If this is a DefInit we need to delete the RecordRecTy.
if (getKind() == IK_DefInit)
delete Ty;
}
public:
static bool classof(const Init *I) {