Use C++11 for loops, from clang-migrate. No functional change intended

This commit is contained in:
Wilson Snyder
2020-11-10 22:10:38 -05:00
parent 44eb362a18
commit 79d33bf1ee
39 changed files with 152 additions and 199 deletions
+9 -9
View File
@@ -291,10 +291,10 @@ private:
if (!m_pliVertexp) {
m_pliVertexp = new SplitPliVertex(&m_graph, nodep); // m_graph.clear() will delete it
}
for (VStack::iterator it = m_stmtStackps.begin(); it != m_stmtStackps.end(); ++it) {
for (const auto& vtxp : m_stmtStackps) {
// Both ways...
new SplitScorebdEdge(&m_graph, *it, m_pliVertexp);
new SplitScorebdEdge(&m_graph, m_pliVertexp, *it);
new SplitScorebdEdge(&m_graph, vtxp, m_pliVertexp);
new SplitScorebdEdge(&m_graph, m_pliVertexp, vtxp);
}
}
void scoreboardPushStmt(AstNode* nodep) {
@@ -709,7 +709,7 @@ public:
void go() {
// Create a new always for each color
const ColorSet& colors = m_ifColorp->colors();
for (ColorSet::const_iterator color = colors.begin(); color != colors.end(); ++color) {
for (unsigned int color : colors) {
// We don't need to clone m_origAlwaysp->sensesp() here;
// V3Activate already moved it to a parent node.
AstAlways* alwaysp
@@ -718,7 +718,7 @@ public:
// We'll strip these out after the blocks are fully cloned.
AstSplitPlaceholder* placeholderp = makePlaceholderp();
alwaysp->addStmtp(placeholderp);
m_addAfter[*color] = placeholderp;
m_addAfter[color] = placeholderp;
m_newBlocksp->push_back(alwaysp);
}
// Scan the body of the always. We'll handle if/else
@@ -761,7 +761,7 @@ protected:
typedef std::unordered_map<uint32_t, AstNodeIf*> CloneMap;
CloneMap clones;
for (ColorSet::const_iterator color = colors.begin(); color != colors.end(); ++color) {
for (unsigned int color : colors) {
// Clone this if into its set of split blocks
AstSplitPlaceholder* if_placeholderp = makePlaceholderp();
AstSplitPlaceholder* else_placeholderp = makePlaceholderp();
@@ -775,9 +775,9 @@ protected:
clonep->unique0Pragma(origp->unique0Pragma());
clonep->priorityPragma(origp->priorityPragma());
}
clones[*color] = clonep;
m_addAfter[*color]->addNextHere(clonep);
m_addAfter[*color] = if_placeholderp;
clones[color] = clonep;
m_addAfter[color]->addNextHere(clonep);
m_addAfter[color] = if_placeholderp;
}
iterateAndNextNull(nodep->ifsp());