[TableGen] Fix a memory leak.
[oota-llvm.git] / lib / TableGen / Record.cpp
index 348a769dc8d366dc6e4aeb291fd608c58599d899..67ee7f1df64df82188803d64be0806ae53c131ac 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())
     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;
     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())
     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;
     return BO;
   }
   return nullptr;