summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2015-04-22 02:09:47 +0000
committerCraig Topper <craig.topper@gmail.com>2015-04-22 02:09:47 +0000
commit5def98eaee56e117fba56491bc396764dd69eac2 (patch)
treec877a30f37200af0ee7bdf4cbd9443c41371e8d4
parentf8012eb8267209fc9172cd30939e496caa401fd7 (diff)
[TableGen] Use StringRecTy::get() instead of allocating (and leaking) a StringRecTy object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235466 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/TableGen/Record.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp
index 29217d74c9..21680baf94 100644
--- a/lib/TableGen/Record.cpp
+++ b/lib/TableGen/Record.cpp
@@ -253,7 +253,7 @@ Init *StringRecTy::convertValue(UnOpInit *BO) {
Init *L = BO->getOperand()->convertInitializerTo(this);
if (!L) return nullptr;
if (L != BO->getOperand())
- return UnOpInit::get(UnOpInit::CAST, L, new StringRecTy);
+ return UnOpInit::get(UnOpInit::CAST, L, StringRecTy::get());
return BO;
}
@@ -266,7 +266,7 @@ Init *StringRecTy::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::STRCONCAT, L, R, new StringRecTy);
+ return BinOpInit::get(BinOpInit::STRCONCAT, L, R, StringRecTy::get());
return BO;
}