summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen
diff options
context:
space:
mode:
authorAnton Yartsev <anton.yartsev@gmail.com>2014-09-25 19:55:58 +0000
committerAnton Yartsev <anton.yartsev@gmail.com>2014-09-25 19:55:58 +0000
commit3fa65d4ef488a53105ab2994b997a63683e86787 (patch)
tree59bb45ab1579af384c541fc4fc2c469ec66830ef /llvm/lib/TableGen
parent0d0560c37ad7edd1327eff73826f87bd8964c4b6 (diff)
downloadbcm5719-llvm-3fa65d4ef488a53105ab2994b997a63683e86787.tar.gz
bcm5719-llvm-3fa65d4ef488a53105ab2994b997a63683e86787.zip
Refactoring: raw pointer -> unique_ptr
llvm-svn: 218462
Diffstat (limited to 'llvm/lib/TableGen')
-rw-r--r--llvm/lib/TableGen/TGParser.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp
index f2910019ed9..2e67f5fa977 100644
--- a/llvm/lib/TableGen/TGParser.cpp
+++ b/llvm/lib/TableGen/TGParser.cpp
@@ -232,16 +232,14 @@ bool TGParser::AddSubMultiClass(MultiClass *CurMC,
i != iend;
++i) {
// Clone the def and add it to the current multiclass
- Record *NewDef = new Record(**i);
+ auto NewDef = make_unique<Record>(**i);
// Add all of the values in the superclass into the current def.
for (unsigned i = 0, e = MCVals.size(); i != e; ++i)
- if (AddValue(NewDef, SubMultiClass.RefRange.Start, MCVals[i])) {
- delete NewDef;
+ if (AddValue(NewDef.get(), SubMultiClass.RefRange.Start, MCVals[i]))
return true;
- }
- CurMC->DefPrototypes.push_back(NewDef);
+ CurMC->DefPrototypes.push_back(NewDef.release());
}
const std::vector<Init *> &SMCTArgs = SMC->Rec.getTemplateArgs();
OpenPOWER on IntegriCloud