diff options
author | Javed Absar <javed.absar@arm.com> | 2017-10-16 06:43:54 +0000 |
---|---|---|
committer | Javed Absar <javed.absar@arm.com> | 2017-10-16 06:43:54 +0000 |
commit | 776bf1de012985f5fcff3284eb10d6d163264b91 (patch) | |
tree | cd9730c26525147bc8ae1eef8bd02fc5f9fc6e44 /llvm/utils/TableGen/DAGISelMatcher.cpp | |
parent | 01805b674728fcfeb2c29e1aa15966e22acc1605 (diff) | |
download | bcm5719-llvm-776bf1de012985f5fcff3284eb10d6d163264b91.tar.gz bcm5719-llvm-776bf1de012985f5fcff3284eb10d6d163264b91.zip |
[TableGen] Range loopify DAGISelMatcher. NFC.
llvm-svn: 315891
Diffstat (limited to 'llvm/utils/TableGen/DAGISelMatcher.cpp')
-rw-r--r-- | llvm/utils/TableGen/DAGISelMatcher.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/llvm/utils/TableGen/DAGISelMatcher.cpp b/llvm/utils/TableGen/DAGISelMatcher.cpp index 6ac3958e0f4..4727b56453e 100644 --- a/llvm/utils/TableGen/DAGISelMatcher.cpp +++ b/llvm/utils/TableGen/DAGISelMatcher.cpp @@ -80,18 +80,18 @@ bool Matcher::canMoveBeforeNode(const Matcher *Other) const { ScopeMatcher::~ScopeMatcher() { - for (unsigned i = 0, e = Children.size(); i != e; ++i) - delete Children[i]; + for (Matcher *C : Children) + delete C; } SwitchOpcodeMatcher::~SwitchOpcodeMatcher() { - for (unsigned i = 0, e = Cases.size(); i != e; ++i) - delete Cases[i].second; + for (auto &C : Cases) + delete C.second; } SwitchTypeMatcher::~SwitchTypeMatcher() { - for (unsigned i = 0, e = Cases.size(); i != e; ++i) - delete Cases[i].second; + for (auto &C : Cases) + delete C.second; } CheckPredicateMatcher::CheckPredicateMatcher(const TreePredicateFn &pred) @@ -107,11 +107,11 @@ TreePredicateFn CheckPredicateMatcher::getPredicate() const { void ScopeMatcher::printImpl(raw_ostream &OS, unsigned indent) const { OS.indent(indent) << "Scope\n"; - for (unsigned i = 0, e = getNumChildren(); i != e; ++i) { - if (!getChild(i)) + for (const Matcher *C : Children) { + if (!C) OS.indent(indent+1) << "NULL POINTER\n"; else - getChild(i)->print(OS, indent+2); + C->print(OS, indent+2); } } @@ -162,9 +162,9 @@ void CheckOpcodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const { void SwitchOpcodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const { OS.indent(indent) << "SwitchOpcode: {\n"; - for (unsigned i = 0, e = Cases.size(); i != e; ++i) { - OS.indent(indent) << "case " << Cases[i].first->getEnumName() << ":\n"; - Cases[i].second->print(OS, indent+2); + for (const auto &C : Cases) { + OS.indent(indent) << "case " << C.first->getEnumName() << ":\n"; + C.second->print(OS, indent+2); } OS.indent(indent) << "}\n"; } @@ -177,9 +177,9 @@ void CheckTypeMatcher::printImpl(raw_ostream &OS, unsigned indent) const { void SwitchTypeMatcher::printImpl(raw_ostream &OS, unsigned indent) const { OS.indent(indent) << "SwitchType: {\n"; - for (unsigned i = 0, e = Cases.size(); i != e; ++i) { - OS.indent(indent) << "case " << getEnumName(Cases[i].first) << ":\n"; - Cases[i].second->print(OS, indent+2); + for (const auto &C : Cases) { + OS.indent(indent) << "case " << getEnumName(C.first) << ":\n"; + C.second->print(OS, indent+2); } OS.indent(indent) << "}\n"; } |