[TableGen] Fix a memory leak.
authorCraig Topper <craig.topper@gmail.com>
Wed, 20 May 2015 05:40:09 +0000 (05:40 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 20 May 2015 05:40:09 +0000 (05:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237774 91177308-0d34-0410-b5e6-96231b3b80d8

lib/TableGen/Record.cpp

index 348a769..67ee7f1 100644 (file)
@@ -325,7 +325,7 @@ Init *DagRecTy::convertValue(UnOpInit *BO) {
     Init *L = BO->getOperand()->convertInitializerTo(this);
     if (!L) return nullptr;
     if (L != BO->getOperand())
-      return UnOpInit::get(UnOpInit::CAST, L, new DagRecTy);
+      return UnOpInit::get(UnOpInit::CAST, L, DagRecTy::get());
     return BO;
   }
   return nullptr;
@@ -337,7 +337,7 @@ Init *DagRecTy::convertValue(BinOpInit *BO) {
     Init *R = BO->getRHS()->convertInitializerTo(this);
     if (!L || !R) return nullptr;
     if (L != BO->getLHS() || R != BO->getRHS())
-      return BinOpInit::get(BinOpInit::CONCAT, L, R, new DagRecTy);
+      return BinOpInit::get(BinOpInit::CONCAT, L, R, DagRecTy::get());
     return BO;
   }
   return nullptr;