From: Craig Topper Date: Wed, 20 May 2015 05:40:09 +0000 (+0000) Subject: [TableGen] Fix a memory leak. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ee25444b068bdeba24f38d69844fb4b7f79d7bc2;p=oota-llvm.git [TableGen] Fix a memory leak. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237774 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index 348a769dc8d..67ee7f1df64 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -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;