Internals: Favor const_iterator (in a few obvious spots, more needed). No functional change.
This commit is contained in:
parent
57068b95ef
commit
5d9d1cc09f
|
@ -173,12 +173,12 @@ void VlThreadPool::profileDump(const char* filenamep, vluint64_t ticksElapsed) {
|
||||||
VlMTaskVertex::yields());
|
VlMTaskVertex::yields());
|
||||||
|
|
||||||
vluint32_t thread_id = 0;
|
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) {
|
pit != m_allProfiles.end(); ++pit) {
|
||||||
++thread_id;
|
++thread_id;
|
||||||
|
|
||||||
bool printing = false; // False while in warmup phase
|
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) {
|
eit != (*pit)->end(); ++eit) {
|
||||||
switch (eit->m_type) {
|
switch (eit->m_type) {
|
||||||
case VlProfileRec::TYPE_BARRIER:
|
case VlProfileRec::TYPE_BARRIER:
|
||||||
|
|
|
@ -350,7 +350,7 @@ void V3Graph::dumpDotFile(const string& filename, bool colorAsSubgraph) const {
|
||||||
// Print vertices
|
// Print vertices
|
||||||
int n = 0;
|
int n = 0;
|
||||||
string subgr;
|
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;
|
string vertexSubgraph = it->first;
|
||||||
V3GraphVertex* vertexp = it->second;
|
V3GraphVertex* vertexp = it->second;
|
||||||
numMap[vertexp] = n;
|
numMap[vertexp] = n;
|
||||||
|
|
|
@ -46,7 +46,7 @@ class V3LanguageWords {
|
||||||
static const_iterator begin() { return s().s_kwdMap.begin(); }
|
static const_iterator begin() { return s().s_kwdMap.begin(); }
|
||||||
static const_iterator end() { return s().s_kwdMap.end(); }
|
static const_iterator end() { return s().s_kwdMap.end(); }
|
||||||
static string isKeyword(const string& kwd) {
|
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 "";
|
if (it == s().s_kwdMap.end()) return "";
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,11 +55,9 @@ void V3LinkLevel::modSortByLevel() {
|
||||||
|
|
||||||
ModVec mods; // Modules
|
ModVec mods; // Modules
|
||||||
ModVec tops; // Top level modules
|
ModVec tops; // Top level modules
|
||||||
for (AstNodeModule* nodep = v3Global.rootp()->modulesp();
|
for (AstNodeModule* nodep = v3Global.rootp()->modulesp(); nodep;
|
||||||
nodep; nodep=VN_CAST(nodep->nextp(), NodeModule)) {
|
nodep = VN_CAST(nodep->nextp(), NodeModule)) {
|
||||||
if (nodep->level()<=2) {
|
if (nodep->level() <= 2) tops.push_back(nodep);
|
||||||
tops.push_back(nodep);
|
|
||||||
}
|
|
||||||
mods.push_back(nodep);
|
mods.push_back(nodep);
|
||||||
}
|
}
|
||||||
if (tops.size() >= 2) {
|
if (tops.size() >= 2) {
|
||||||
|
@ -69,7 +67,7 @@ void V3LinkLevel::modSortByLevel() {
|
||||||
<<secp->warnMore()
|
<<secp->warnMore()
|
||||||
<<"... Suggest see manual; fix the duplicates, or use --top-module to select top."
|
<<"... Suggest see manual; fix the duplicates, or use --top-module to select top."
|
||||||
<<V3Error::warnContextNone());
|
<<V3Error::warnContextNone());
|
||||||
for (ModVec::iterator it = tops.begin(); it != tops.end(); ++it) {
|
for (ModVec::const_iterator it = tops.begin(); it != tops.end(); ++it) {
|
||||||
AstNode* alsop = *it;
|
AstNode* alsop = *it;
|
||||||
std::cout<<secp->warnMore()<<"... Top module "<<alsop->prettyNameQ()<<endl
|
std::cout<<secp->warnMore()<<"... Top module "<<alsop->prettyNameQ()<<endl
|
||||||
<<alsop->warnContextSecondary();
|
<<alsop->warnContextSecondary();
|
||||||
|
|
|
@ -247,7 +247,7 @@ void V3Options::addArg(const string& arg) {
|
||||||
|
|
||||||
string V3Options::allArgsString() {
|
string V3Options::allArgsString() {
|
||||||
string out;
|
string out;
|
||||||
for (std::list<string>::iterator it=m_impp->m_allArgs.begin();
|
for (std::list<string>::const_iterator it = m_impp->m_allArgs.begin();
|
||||||
it != m_impp->m_allArgs.end(); ++it) {
|
it != m_impp->m_allArgs.end(); ++it) {
|
||||||
if (out != "") out += " ";
|
if (out != "") out += " ";
|
||||||
out += *it;
|
out += *it;
|
||||||
|
|
|
@ -88,10 +88,8 @@ public:
|
||||||
PartPtrIdMap() : m_nextId(0) {}
|
PartPtrIdMap() : m_nextId(0) {}
|
||||||
// METHODS
|
// METHODS
|
||||||
vluint64_t findId(const void* ptrp) const {
|
vluint64_t findId(const void* ptrp) const {
|
||||||
PtrMap::iterator it = m_id.find(ptrp);
|
PtrMap::const_iterator it = m_id.find(ptrp);
|
||||||
if (it != m_id.end()) {
|
if (it != m_id.end()) return it->second;
|
||||||
return it->second;
|
|
||||||
}
|
|
||||||
m_id[ptrp] = m_nextId;
|
m_id[ptrp] = m_nextId;
|
||||||
return m_nextId++;
|
return m_nextId++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,12 +140,12 @@ class StatsReport {
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
os<<" Stat "<<std::left<<std::setw(maxWidth-5-2)<<"";
|
os<<" Stat "<<std::left<<std::setw(maxWidth-5-2)<<"";
|
||||||
for (Stages::iterator it = stages.begin(); it!=stages.end(); ++it) {
|
for (Stages::const_iterator it = stages.begin(); it != stages.end(); ++it) {
|
||||||
os<<" "<<std::left<<std::setw(9)<<*it;
|
os<<" "<<std::left<<std::setw(9)<<*it;
|
||||||
}
|
}
|
||||||
os<<endl;
|
os<<endl;
|
||||||
os<<" -------- "<<std::left<<std::setw(maxWidth-5-2)<<"";
|
os<<" -------- "<<std::left<<std::setw(maxWidth-5-2)<<"";
|
||||||
for (Stages::iterator it = stages.begin(); it!=stages.end(); ++it) {
|
for (Stages::const_iterator it = stages.begin(); it != stages.end(); ++it) {
|
||||||
os<<" "<<std::left<<std::setw(9)<<"-------";
|
os<<" "<<std::left<<std::setw(9)<<"-------";
|
||||||
}
|
}
|
||||||
//os<<endl;
|
//os<<endl;
|
||||||
|
@ -154,7 +154,7 @@ class StatsReport {
|
||||||
string lastName = "__NONE__";
|
string lastName = "__NONE__";
|
||||||
string lastCommaName = "__NONE__";
|
string lastCommaName = "__NONE__";
|
||||||
unsigned col = 0;
|
unsigned col = 0;
|
||||||
for (ByName::iterator it = byName.begin(); it!=byName.end(); ++it) {
|
for (ByName::const_iterator it = byName.begin(); it != byName.end(); ++it) {
|
||||||
const V3Statistic* repp = it->second;
|
const V3Statistic* repp = it->second;
|
||||||
if (lastName != repp->name()) {
|
if (lastName != repp->name()) {
|
||||||
lastName = repp->name();
|
lastName = repp->name();
|
||||||
|
|
|
@ -689,7 +689,7 @@ void V3TSP::selfTestString() {
|
||||||
expect.push_back("3");
|
expect.push_back("3");
|
||||||
|
|
||||||
if (VL_UNCOVERABLE(expect != result)) {
|
if (VL_UNCOVERABLE(expect != result)) {
|
||||||
for (std::vector<string>::iterator it = result.begin(); it != result.end(); ++it) {
|
for (std::vector<string>::const_iterator it = result.begin(); it != result.end(); ++it) {
|
||||||
cout<<*it<<" ";
|
cout<<*it<<" ";
|
||||||
}
|
}
|
||||||
cout<<endl;
|
cout<<endl;
|
||||||
|
|
|
@ -157,7 +157,7 @@ int main(int argc, char** argv, char** env) {
|
||||||
|
|
||||||
{
|
{
|
||||||
const VlStringSet& readFiles = top.opt.readFiles();
|
const VlStringSet& readFiles = top.opt.readFiles();
|
||||||
for (VlStringSet::iterator it = readFiles.begin(); it != readFiles.end(); ++it) {
|
for (VlStringSet::const_iterator it = readFiles.begin(); it != readFiles.end(); ++it) {
|
||||||
string filename = *it;
|
string filename = *it;
|
||||||
top.readCoverage(filename);
|
top.readCoverage(filename);
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ int main(int argc, char** argv, char** env) {
|
||||||
V3Error::abortIfWarnings();
|
V3Error::abortIfWarnings();
|
||||||
if (top.opt.unlink()) {
|
if (top.opt.unlink()) {
|
||||||
const VlStringSet& readFiles = top.opt.readFiles();
|
const VlStringSet& readFiles = top.opt.readFiles();
|
||||||
for (VlStringSet::iterator it = readFiles.begin(); it != readFiles.end(); ++it) {
|
for (VlStringSet::const_iterator it = readFiles.begin(); it != readFiles.end(); ++it) {
|
||||||
string filename = *it;
|
string filename = *it;
|
||||||
unlink(filename.c_str());
|
unlink(filename.c_str());
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,7 +123,7 @@ public:
|
||||||
void dump() {
|
void dump() {
|
||||||
UINFO(2,"dumpPoints...\n");
|
UINFO(2,"dumpPoints...\n");
|
||||||
VlcPoint::dumpHeader();
|
VlcPoint::dumpHeader();
|
||||||
for (VlcPoints::ByName::iterator it=begin(); it!=end(); ++it) {
|
for (VlcPoints::ByName::const_iterator it = begin(); it != end(); ++it) {
|
||||||
const VlcPoint& point = pointNumber(it->second);
|
const VlcPoint& point = pointNumber(it->second);
|
||||||
point.dump();
|
point.dump();
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ public:
|
||||||
}
|
}
|
||||||
vluint64_t findAddPoint(const string& name, vluint64_t count) {
|
vluint64_t findAddPoint(const string& name, vluint64_t count) {
|
||||||
vluint64_t pointnum;
|
vluint64_t pointnum;
|
||||||
NameMap::iterator iter = m_nameMap.find(name);
|
NameMap::const_iterator iter = m_nameMap.find(name);
|
||||||
if (iter != m_nameMap.end()) {
|
if (iter != m_nameMap.end()) {
|
||||||
pointnum = iter->second;
|
pointnum = iter->second;
|
||||||
m_points[pointnum].countInc(count);
|
m_points[pointnum].countInc(count);
|
||||||
|
|
|
@ -118,7 +118,7 @@ public:
|
||||||
void dump(bool bucketsToo) {
|
void dump(bool bucketsToo) {
|
||||||
UINFO(2,"dumpTests...\n");
|
UINFO(2,"dumpTests...\n");
|
||||||
VlcTest::dumpHeader();
|
VlcTest::dumpHeader();
|
||||||
for (VlcTests::ByName::iterator it=begin(); it!=end(); ++it) {
|
for (VlcTests::ByName::const_iterator it = begin(); it != end(); ++it) {
|
||||||
(*it)->dump(bucketsToo);
|
(*it)->dump(bucketsToo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ void VlcTop::writeCoverage(const string& filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
os << "# SystemC::Coverage-3" << endl;
|
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);
|
const VlcPoint& point = m_points.pointNumber(it->second);
|
||||||
os <<"C '"<<point.name()<<"' " << point.count()<<endl;
|
os <<"C '"<<point.name()<<"' " << point.count()<<endl;
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ void VlcTop::rank() {
|
||||||
|
|
||||||
// Sort by computrons, so fast tests get selected first
|
// Sort by computrons, so fast tests get selected first
|
||||||
std::vector<VlcTest*> bytime;
|
std::vector<VlcTest*> 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;
|
VlcTest* testp = *it;
|
||||||
if (testp->bucketsCovered()) { // else no points, so can't help us
|
if (testp->bucketsCovered()) { // else no points, so can't help us
|
||||||
bytime.push_back(*it);
|
bytime.push_back(*it);
|
||||||
|
@ -107,7 +107,7 @@ void VlcTop::rank() {
|
||||||
sort(bytime.begin(), bytime.end(), CmpComputrons()); // Sort the vector
|
sort(bytime.begin(), bytime.end(), CmpComputrons()); // Sort the vector
|
||||||
|
|
||||||
VlcBuckets remaining;
|
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);
|
VlcPoint* pointp = &points().pointNumber(it->second);
|
||||||
// If any tests hit this point, then we'll need to cover it.
|
// If any tests hit this point, then we'll need to cover it.
|
||||||
if (pointp->testsCovering()) { remaining.addData(pointp->pointNum(), 1); }
|
if (pointp->testsCovering()) { remaining.addData(pointp->pointNum(), 1); }
|
||||||
|
@ -145,7 +145,7 @@ void VlcTop::rank() {
|
||||||
|
|
||||||
void VlcTop::annotateCalc() {
|
void VlcTop::annotateCalc() {
|
||||||
// Calculate per-line information into filedata structure
|
// 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);
|
const VlcPoint& point = m_points.pointNumber(it->second);
|
||||||
string filename = point.filename();
|
string filename = point.filename();
|
||||||
int lineno = point.lineno();
|
int lineno = point.lineno();
|
||||||
|
@ -171,9 +171,10 @@ void VlcTop::annotateCalcNeeded() {
|
||||||
//UINFO(1,"Source "<<source.name()<<endl);
|
//UINFO(1,"Source "<<source.name()<<endl);
|
||||||
if (opt.annotateAll()) source.needed(true);
|
if (opt.annotateAll()) source.needed(true);
|
||||||
VlcSource::LinenoMap& lines = source.lines();
|
VlcSource::LinenoMap& lines = source.lines();
|
||||||
for (VlcSource::LinenoMap::iterator lit=lines.begin(); lit!=lines.end(); ++lit) {
|
for (VlcSource::LinenoMap::iterator lit = lines.begin(); lit != lines.end(); ++lit) {
|
||||||
VlcSource::ColumnMap& cmap = lit->second;
|
VlcSource::ColumnMap& cmap = lit->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;
|
VlcSourceCount& col = cit->second;
|
||||||
//UINFO(0,"Source "<<source.name()<<":"<<col.lineno()<<":"<<col.column()<<endl);
|
//UINFO(0,"Source "<<source.name()<<":"<<col.lineno()<<":"<<col.column()<<endl);
|
||||||
++totCases;
|
++totCases;
|
||||||
|
@ -227,7 +228,8 @@ void VlcTop::annotateOutputFiles(const string& dirname) {
|
||||||
VlcSource::LinenoMap::iterator lit=lines.find(lineno);
|
VlcSource::LinenoMap::iterator lit=lines.find(lineno);
|
||||||
if (lit != lines.end()) {
|
if (lit != lines.end()) {
|
||||||
VlcSource::ColumnMap& cmap = lit->second;
|
VlcSource::ColumnMap& cmap = lit->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;
|
VlcSourceCount& col = cit->second;
|
||||||
//UINFO(0,"Source "<<source.name()<<":"<<col.lineno()<<":"<<col.column()<<endl);
|
//UINFO(0,"Source "<<source.name()<<":"<<col.lineno()<<":"<<col.column()<<endl);
|
||||||
os<<(col.ok()?" ":"%")
|
os<<(col.ok()?" ":"%")
|
||||||
|
|
Loading…
Reference in New Issue