summaryrefslogtreecommitdiff
path: root/utils/TableGen
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-21 21:49:08 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-21 21:49:08 +0000
commit2b77be29da2ae84e8ba11f20ee6464e50d4347de (patch)
tree27b4ab1973dea32c9e293f336b455115c5237547 /utils/TableGen
parent91c655736e8a48ac4c464a1c95f29d6147370e57 (diff)
downloadllvm-2b77be29da2ae84e8ba11f20ee6464e50d4347de.tar.gz
llvm-2b77be29da2ae84e8ba11f20ee6464e50d4347de.tar.bz2
llvm-2b77be29da2ae84e8ba11f20ee6464e50d4347de.tar.xz
Use Regex objects by value (rather than 'new'ed) in CodeGenSchedule.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206800 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r--utils/TableGen/CodeGenSchedule.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/utils/TableGen/CodeGenSchedule.cpp b/utils/TableGen/CodeGenSchedule.cpp
index 3a6db250ee..95d31862ad 100644
--- a/utils/TableGen/CodeGenSchedule.cpp
+++ b/utils/TableGen/CodeGenSchedule.cpp
@@ -59,7 +59,7 @@ struct InstRegexOp : public SetTheory::Operator {
void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
ArrayRef<SMLoc> Loc) override {
- SmallVector<Regex*, 4> RegexList;
+ SmallVector<Regex, 4> RegexList;
for (DagInit::const_arg_iterator
AI = Expr->arg_begin(), AE = Expr->arg_end(); AI != AE; ++AI) {
StringInit *SI = dyn_cast<StringInit>(*AI);
@@ -72,17 +72,15 @@ struct InstRegexOp : public SetTheory::Operator {
pat.insert(0, "^(");
pat.insert(pat.end(), ')');
}
- RegexList.push_back(new Regex(pat));
+ RegexList.push_back(Regex(pat));
}
for (CodeGenTarget::inst_iterator I = Target.inst_begin(),
E = Target.inst_end(); I != E; ++I) {
- for (SmallVectorImpl<Regex*>::iterator
- RI = RegexList.begin(), RE = RegexList.end(); RI != RE; ++RI) {
- if ((*RI)->match((*I)->TheDef->getName()))
+ for (auto &R : RegexList) {
+ if (R.match((*I)->TheDef->getName()))
Elts.insert((*I)->TheDef);
}
}
- DeleteContainerPointers(RegexList);
}
};
} // end anonymous namespace