[llvm] r237774 - [TableGen] Fix a memory leak.

Craig Topper craig.topper at gmail.com
Tue May 19 22:40:09 PDT 2015


Author: ctopper
Date: Wed May 20 00:40:09 2015
New Revision: 237774

URL: http://llvm.org/viewvc/llvm-project?rev=237774&view=rev
Log:
[TableGen] Fix a memory leak.

Modified:
    llvm/trunk/lib/TableGen/Record.cpp

Modified: llvm/trunk/lib/TableGen/Record.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=237774&r1=237773&r2=237774&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/Record.cpp (original)
+++ llvm/trunk/lib/TableGen/Record.cpp Wed May 20 00:40:09 2015
@@ -325,7 +325,7 @@ Init *DagRecTy::convertValue(UnOpInit *B
     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 *
     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;





More information about the llvm-commits mailing list