diff --git a/include/verilated_threads.cpp b/include/verilated_threads.cpp index 1c5fda43b..5cdc12b5e 100644 --- a/include/verilated_threads.cpp +++ b/include/verilated_threads.cpp @@ -173,12 +173,12 @@ void VlThreadPool::profileDump(const char* filenamep, vluint64_t ticksElapsed) { VlMTaskVertex::yields()); vluint32_t thread_id = 0; - for (ProfileSet::iterator pit = m_allProfiles.begin(); + for (ProfileSet::const_iterator pit = m_allProfiles.begin(); pit != m_allProfiles.end(); ++pit) { ++thread_id; bool printing = false; // False while in warmup phase - for (ProfileTrace::iterator eit = (*pit)->begin(); + for (ProfileTrace::const_iterator eit = (*pit)->begin(); eit != (*pit)->end(); ++eit) { switch (eit->m_type) { case VlProfileRec::TYPE_BARRIER: diff --git a/src/V3Graph.cpp b/src/V3Graph.cpp index 5233e4b6d..a15a6d2be 100644 --- a/src/V3Graph.cpp +++ b/src/V3Graph.cpp @@ -350,7 +350,7 @@ void V3Graph::dumpDotFile(const string& filename, bool colorAsSubgraph) const { // Print vertices int n = 0; string subgr; - for (SubgraphMmap::iterator it = subgraphs.begin(); it!=subgraphs.end(); ++it) { + for (SubgraphMmap::const_iterator it = subgraphs.begin(); it != subgraphs.end(); ++it) { string vertexSubgraph = it->first; V3GraphVertex* vertexp = it->second; numMap[vertexp] = n; diff --git a/src/V3LanguageWords.h b/src/V3LanguageWords.h index 2319ecfe8..aab0466cc 100644 --- a/src/V3LanguageWords.h +++ b/src/V3LanguageWords.h @@ -46,7 +46,7 @@ class V3LanguageWords { static const_iterator begin() { return s().s_kwdMap.begin(); } static const_iterator end() { return s().s_kwdMap.end(); } static string isKeyword(const string& kwd) { - KeywordMap::iterator it = s().s_kwdMap.find(kwd); + KeywordMap::const_iterator it = s().s_kwdMap.find(kwd); if (it == s().s_kwdMap.end()) return ""; return it->second; } diff --git a/src/V3LinkLevel.cpp b/src/V3LinkLevel.cpp index abdfa423a..2d91daf5e 100644 --- a/src/V3LinkLevel.cpp +++ b/src/V3LinkLevel.cpp @@ -55,11 +55,9 @@ void V3LinkLevel::modSortByLevel() { ModVec mods; // Modules ModVec tops; // Top level modules - for (AstNodeModule* nodep = v3Global.rootp()->modulesp(); - nodep; nodep=VN_CAST(nodep->nextp(), NodeModule)) { - if (nodep->level()<=2) { - tops.push_back(nodep); - } + for (AstNodeModule* nodep = v3Global.rootp()->modulesp(); nodep; + nodep = VN_CAST(nodep->nextp(), NodeModule)) { + if (nodep->level() <= 2) tops.push_back(nodep); mods.push_back(nodep); } if (tops.size() >= 2) { @@ -69,7 +67,7 @@ void V3LinkLevel::modSortByLevel() { <warnMore() <<"... Suggest see manual; fix the duplicates, or use --top-module to select top." <warnMore()<<"... Top module "<prettyNameQ()<warnContextSecondary(); diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 71500599f..48b40f45d 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -247,7 +247,7 @@ void V3Options::addArg(const string& arg) { string V3Options::allArgsString() { string out; - for (std::list::iterator it=m_impp->m_allArgs.begin(); + for (std::list::const_iterator it = m_impp->m_allArgs.begin(); it != m_impp->m_allArgs.end(); ++it) { if (out != "") out += " "; out += *it; diff --git a/src/V3Partition.h b/src/V3Partition.h index dfa737b0b..21fb3560c 100644 --- a/src/V3Partition.h +++ b/src/V3Partition.h @@ -88,10 +88,8 @@ public: PartPtrIdMap() : m_nextId(0) {} // METHODS vluint64_t findId(const void* ptrp) const { - PtrMap::iterator it = m_id.find(ptrp); - if (it != m_id.end()) { - return it->second; - } + PtrMap::const_iterator it = m_id.find(ptrp); + if (it != m_id.end()) return it->second; m_id[ptrp] = m_nextId; return m_nextId++; } diff --git a/src/V3StatsReport.cpp b/src/V3StatsReport.cpp index a40fd5727..ec2152433 100644 --- a/src/V3StatsReport.cpp +++ b/src/V3StatsReport.cpp @@ -140,12 +140,12 @@ class StatsReport { // Header os<<" Stat "<second; if (lastName != repp->name()) { lastName = repp->name(); diff --git a/src/V3TSP.cpp b/src/V3TSP.cpp index 8a9d2751b..f829dcc3c 100644 --- a/src/V3TSP.cpp +++ b/src/V3TSP.cpp @@ -689,7 +689,7 @@ void V3TSP::selfTestString() { expect.push_back("3"); if (VL_UNCOVERABLE(expect != result)) { - for (std::vector::iterator it = result.begin(); it != result.end(); ++it) { + for (std::vector::const_iterator it = result.begin(); it != result.end(); ++it) { cout<<*it<<" "; } cout<second); point.dump(); } @@ -133,7 +133,7 @@ public: } vluint64_t findAddPoint(const string& name, vluint64_t count) { vluint64_t pointnum; - NameMap::iterator iter = m_nameMap.find(name); + NameMap::const_iterator iter = m_nameMap.find(name); if (iter != m_nameMap.end()) { pointnum = iter->second; m_points[pointnum].countInc(count); diff --git a/src/VlcTest.h b/src/VlcTest.h index 3411f97e6..89ab1ead5 100644 --- a/src/VlcTest.h +++ b/src/VlcTest.h @@ -118,7 +118,7 @@ public: void dump(bool bucketsToo) { UINFO(2,"dumpTests...\n"); VlcTest::dumpHeader(); - for (VlcTests::ByName::iterator it=begin(); it!=end(); ++it) { + for (VlcTests::ByName::const_iterator it = begin(); it != end(); ++it) { (*it)->dump(bucketsToo); } } diff --git a/src/VlcTop.cpp b/src/VlcTop.cpp index d18c9a56d..a353bdbbb 100644 --- a/src/VlcTop.cpp +++ b/src/VlcTop.cpp @@ -75,7 +75,7 @@ void VlcTop::writeCoverage(const string& filename) { } os << "# SystemC::Coverage-3" << endl; - for (VlcPoints::ByName::iterator it=m_points.begin(); it!=m_points.end(); ++it) { + for (VlcPoints::ByName::const_iterator it = m_points.begin(); it != m_points.end(); ++it) { const VlcPoint& point = m_points.pointNumber(it->second); os <<"C '"< bytime; - for (VlcTests::ByName::iterator it=m_tests.begin(); it!=m_tests.end(); ++it) { + for (VlcTests::ByName::const_iterator it = m_tests.begin(); it != m_tests.end(); ++it) { VlcTest* testp = *it; if (testp->bucketsCovered()) { // else no points, so can't help us bytime.push_back(*it); @@ -107,7 +107,7 @@ void VlcTop::rank() { sort(bytime.begin(), bytime.end(), CmpComputrons()); // Sort the vector VlcBuckets remaining; - for (VlcPoints::ByName::iterator it=m_points.begin(); it!=m_points.end(); ++it) { + for (VlcPoints::ByName::const_iterator it = m_points.begin(); it != m_points.end(); ++it) { VlcPoint* pointp = &points().pointNumber(it->second); // If any tests hit this point, then we'll need to cover it. if (pointp->testsCovering()) { remaining.addData(pointp->pointNum(), 1); } @@ -145,7 +145,7 @@ void VlcTop::rank() { void VlcTop::annotateCalc() { // Calculate per-line information into filedata structure - for (VlcPoints::ByName::iterator it=m_points.begin(); it!=m_points.end(); ++it) { + for (VlcPoints::ByName::const_iterator it = m_points.begin(); it != m_points.end(); ++it) { const VlcPoint& point = m_points.pointNumber(it->second); string filename = point.filename(); int lineno = point.lineno(); @@ -171,9 +171,10 @@ void VlcTop::annotateCalcNeeded() { //UINFO(1,"Source "<second; - for (VlcSource::ColumnMap::iterator cit=cmap.begin(); cit!=cmap.end(); ++cit) { + for (VlcSource::ColumnMap::iterator cit = cmap.begin(); cit != cmap.end(); + ++cit) { VlcSourceCount& col = cit->second; //UINFO(0,"Source "<second; - for (VlcSource::ColumnMap::iterator cit=cmap.begin(); cit!=cmap.end(); ++cit) { + for (VlcSource::ColumnMap::iterator cit = cmap.begin(); cit != cmap.end(); + ++cit) { VlcSourceCount& col = cit->second; //UINFO(0,"Source "<