summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen
diff options
context:
space:
mode:
authorDylan Noblesmith <nobled@dreamwidth.org>2014-08-24 19:10:49 +0000
committerDylan Noblesmith <nobled@dreamwidth.org>2014-08-24 19:10:49 +0000
commit80f0e432eeb59766d63c9224d8cc03f53ff53178 (patch)
tree6189e0381f83267a3cd83f97060cab90762f050a /llvm/lib/TableGen
parentcdd315198779293be5af29b201d3c303ad1ff230 (diff)
downloadbcm5719-llvm-80f0e432eeb59766d63c9224d8cc03f53ff53178.tar.gz
bcm5719-llvm-80f0e432eeb59766d63c9224d8cc03f53ff53178.zip
TableGen: use auto and for-range
llvm-svn: 216348
Diffstat (limited to 'llvm/lib/TableGen')
-rw-r--r--llvm/lib/TableGen/Record.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index cb21be7b762..5ee28c9370a 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -2014,16 +2014,14 @@ void RecordKeeper::dump() const { errs() << *this; }
raw_ostream &llvm::operator<<(raw_ostream &OS, const RecordKeeper &RK) {
OS << "------------- Classes -----------------\n";
- const std::map<std::string, Record*> &Classes = RK.getClasses();
- for (std::map<std::string, Record*>::const_iterator I = Classes.begin(),
- E = Classes.end(); I != E; ++I)
- OS << "class " << *I->second;
+ const auto &Classes = RK.getClasses();
+ for (const auto &C : Classes)
+ OS << "class " << *C.second;
OS << "------------- Defs -----------------\n";
- const std::map<std::string, Record*> &Defs = RK.getDefs();
- for (std::map<std::string, Record*>::const_iterator I = Defs.begin(),
- E = Defs.end(); I != E; ++I)
- OS << "def " << *I->second;
+ const auto &Defs = RK.getDefs();
+ for (const auto &D : Defs)
+ OS << "def " << *D.second;
return OS;
}
@@ -2038,10 +2036,9 @@ RecordKeeper::getAllDerivedDefinitions(const std::string &ClassName) const {
PrintFatalError("ERROR: Couldn't find the `" + ClassName + "' class!\n");
std::vector<Record*> Defs;
- for (std::map<std::string, Record*>::const_iterator I = getDefs().begin(),
- E = getDefs().end(); I != E; ++I)
- if (I->second->isSubClassOf(Class))
- Defs.push_back(I->second);
+ for (const auto &D : getDefs())
+ if (D.second->isSubClassOf(Class))
+ Defs.push_back(D.second);
return Defs;
}
OpenPOWER on IntegriCloud