[PATCH] D37748: [MiSched|TableGen] : Tidy up and modernise. NFC.
Matthias Braun via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 12 09:58:54 PDT 2017
MatzeB accepted this revision.
MatzeB added a comment.
This revision is now accepted and ready to land.
LGTM with nitpicks.
================
Comment at: utils/TableGen/CodeGenSchedule.cpp:165
DEBUG(dbgs() << "+++ PROCESSOR MODELs (addProcModel) +++\n");
- for (unsigned i = 0, N = ProcRecords.size(); i < N; ++i)
- addProcModel(ProcRecords[i]);
+ for (Record *ProcDef : ProcRecords)
+ addProcModel(ProcDef);
----------------
Seeing that the list is called `ProcRecords` I would expect a single element being called `ProcRecord`.
================
Comment at: utils/TableGen/CodeGenSchedule.cpp:206
RecVec Vars = RWDef->getValueAsListOfDefs("Variants");
- for (RecIter VI = Vars.begin(), VE = Vars.end(); VI != VE; ++VI) {
+ for (Record *SVDef : Vars) {
// Visit each RW in the sequence selected by the current variant.
----------------
`Variant` instead of `SVDef`?
================
Comment at: utils/TableGen/CodeGenSchedule.cpp:300-301
// Initialize WriteSequence vectors.
- for (std::vector<CodeGenSchedRW>::iterator WI = SchedWrites.begin(),
- WE = SchedWrites.end(); WI != WE; ++WI) {
- if (!WI->IsSequence)
+ //for (std::vector<CodeGenSchedRW>::iterator WI = SchedWrites.begin(),
+ //WE = SchedWrites.end(); WI != WE; ++WI) {
+ for (CodeGenSchedRW &CGRW : SchedWrites) {
----------------
remove the comments
================
Comment at: utils/TableGen/CodeGenSchedule.cpp:464-465
for (int i = 0; i < Repeat; ++i) {
- for (IdxIter I = SchedWrite.Sequence.begin(), E = SchedWrite.Sequence.end();
- I != E; ++I) {
- expandRWSeqForProc(*I, RWSeq, IsRead, ProcModel);
+ for (unsigned I : SchedWrite.Sequence) { //IdxIter I = SchedWrite.Sequence.begin(), E = SchedWrite.Sequence.end();
+ //I != E; ++I) {
+ expandRWSeqForProc(I, RWSeq, IsRead, ProcModel);
----------------
remove the comments
================
Comment at: utils/TableGen/CodeGenSchedule.cpp:1825
dbgs() << "\n Transitions for Proc ";
- for (std::vector<CodeGenSchedTransition>::const_iterator
- TI = Transitions.begin(), TE = Transitions.end(); TI != TE; ++TI) {
- dumpIdxVec(TI->ProcIndices);
+ for (const CodeGenSchedTransition &CGST : Transitions) {
+ dumpIdxVec(CGST.ProcIndices);
----------------
call the variable `Transition`?
https://reviews.llvm.org/D37748
More information about the llvm-commits
mailing list