[PATCH] D38534: [TablgeGen] : Tidy up CodeGenSchedule. NFC.
Krzysztof Parzyszek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 4 11:06:59 PDT 2017
kparzysz added inline comments.
================
Comment at: utils/TableGen/CodeGenSchedule.cpp:589
+ for (CodeGenProcModel PM :
+ make_range(ProcModels.begin(), ProcModels.end())) {
+ if (!std::count(ProcIndices.begin(), ProcIndices.end(), PM.Index))
----------------
make_range is unnecessary for objects that have "begin" and "end".
================
Comment at: utils/TableGen/CodeGenSchedule.cpp:695
- for (RecIter I = InstDefs->begin(), E = InstDefs->end(); I != E; ++I) {
- InstClassMapTy::const_iterator Pos = InstrClassMap.find(*I);
+ for (Record *InstDef : make_range(InstDefs->begin(), InstDefs->end())) {
+ InstClassMapTy::const_iterator Pos = InstrClassMap.find(InstDef);
----------------
Same here.
================
Comment at: utils/TableGen/CodeGenSchedule.cpp:998
ArrayRef<PredCheck> Term) {
- for (ArrayRef<PredCheck>::iterator I = Term.begin(), E = Term.end();
- I != E; ++I) {
- if (I->Predicate == PredDef)
+ for (const PredCheck &PC: make_range(Term.begin(), Term.end())) {
+ if (PC.Predicate == PredDef)
----------------
And here.
================
Comment at: utils/TableGen/CodeGenSchedule.cpp:1018
- for (RecIter I = RW.Aliases.begin(), E = RW.Aliases.end(); I != E; ++I) {
+ for (Record *Alias : make_range(RW.Aliases.begin(), RW.Aliases.end())) {
const CodeGenSchedRW &AliasRW =
----------------
And here.
================
Comment at: utils/TableGen/CodeGenSchedule.cpp:1507
RecVec ProcResGroups = Records.getAllDerivedDefinitions("ProcResGroup");
- for (RecIter RI = ProcResGroups.begin(), RE = ProcResGroups.end();
- RI != RE; ++RI) {
- if (!(*RI)->getValueInit("SchedModel")->isComplete())
+ for (Record *PRG : make_range(ProcResGroups.begin(), ProcResGroups.end())) {
+ if (!PRG->getValueInit("SchedModel")->isComplete())
----------------
And here.
https://reviews.llvm.org/D38534
More information about the llvm-commits
mailing list