One more feedback from PR 2: don't compare pointers to iterators

This commit is contained in:
Mikko Strandborg 2016-11-17 11:17:20 +02:00
Родитель 23cd014fd4
Коммит d8176fd55a
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -28,15 +28,16 @@ namespace HLSLcc
using namespace std;
res.clear();
Instruction *i = &phase.psInst[0];
// A stack of loopinfo elements (stored in res)
list<LoopInfo *> loopStack;
// Storage for dummy LoopInfo elements to be used for switch-cases. We don't want them cluttering the Loops list so store them here.
list<LoopInfo> dummyLIForSwitches;
while (i != &*phase.psInst.end())
for (std::vector<Instruction>::iterator instItr = phase.psInst.begin(); instItr != phase.psInst.end(); instItr++)
{
Instruction *i = &*instItr;
if (i->eOpcode == OPCODE_LOOP)
{
LoopInfo *currLoopInfo = &*res.insert(res.end(), LoopInfo());
@ -75,7 +76,6 @@ namespace HLSLcc
li->m_ExitPoints.push_back(i);
}
}
i++;
}
}