From aef2b7ea3c1aca2d137cbabbd0a42f1c7b877718 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 2 Apr 2020 08:25:44 -0400 Subject: [PATCH] Internals: clang-format cleanup. No functional change. --- src/V3Unroll.h | 1 + src/VlcMain.cpp | 90 +++++++++++++++++++++++-------------------------- src/VlcTop.cpp | 86 ++++++++++++++++++++++------------------------ 3 files changed, 85 insertions(+), 92 deletions(-) diff --git a/src/V3Unroll.h b/src/V3Unroll.h index 231791cb1..39e588c41 100644 --- a/src/V3Unroll.h +++ b/src/V3Unroll.h @@ -32,6 +32,7 @@ class UnrollStateful { // MEMBERS UnrollVisitor* m_unrollerp; VL_UNCOPYABLE(UnrollStateful); + public: // CONSTRUCTORS UnrollStateful(); diff --git a/src/VlcMain.cpp b/src/VlcMain.cpp index 5595412d8..6670f7826 100644 --- a/src/VlcMain.cpp +++ b/src/VlcMain.cpp @@ -37,13 +37,11 @@ //###################################################################### // VlcOptions -void VlcOptions::addReadFile(const string& filename) { - m_readFiles.insert(filename); -} +void VlcOptions::addReadFile(const string& filename) { m_readFiles.insert(filename); } string VlcOptions::version() { string ver = DTVERSION; - ver += " rev "+cvtToStr(DTVERSION_rev); + ver += " rev " + cvtToStr(DTVERSION_rev); return ver; } @@ -52,10 +50,17 @@ bool VlcOptions::onoff(const char* sw, const char* arg, bool& flag) { // if sw=="-no-arg", then return true (found it), and flag=false // if sw=="-noarg", then return true (found it), and flag=false // else return false - if (arg[0]!='-') v3fatalSrc("OnOff switches must have leading dash."); - if (0==strcmp(sw, arg)) { flag = true; return true; } - else if (0==strncmp(sw, "-no", 3) && (0==strcmp(sw+3, arg+1))) { flag = false; return true; } - else if (0==strncmp(sw, "-no-", 4) && (0==strcmp(sw+4, arg+1))) { flag = false; return true; } + if (arg[0] != '-') v3fatalSrc("OnOff switches must have leading dash."); + if (0 == strcmp(sw, arg)) { + flag = true; + return true; + } else if (0 == strncmp(sw, "-no", 3) && (0 == strcmp(sw + 3, arg + 1))) { + flag = false; + return true; + } else if (0 == strncmp(sw, "-no-", 4) && (0 == strcmp(sw + 4, arg + 1))) { + flag = false; + return true; + } return false; } @@ -64,57 +69,52 @@ void VlcOptions::parseOptsList(int argc, char** argv) { // Note argc and argv DO NOT INCLUDE the filename in [0]!!! // May be called recursively when there are -f files. #define shift { ++i; } - for (int i=0; isecond); - os <<"C '"<computrons() != rhsp->computrons()) { return lhsp->computrons() < rhsp->computrons(); } @@ -89,7 +89,7 @@ struct CmpComputrons { }; void VlcTop::rank() { - UINFO(2,"rank...\n"); + UINFO(2, "rank...\n"); vluint64_t nextrank = 1; // Sort by computrons, so fast tests get selected first @@ -106,7 +106,7 @@ void VlcTop::rank() { 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); } + if (pointp->testsCovering()) remaining.addData(pointp->pointNum(), 1); } // Additional Greedy algorithm @@ -114,10 +114,10 @@ void VlcTop::rank() { // then hierarchically solve a small subset of tests, and take resulting // solution and move up to larger subset of tests. (Aka quick sort.) while (1) { - if (debug()) { UINFO(9,"Left on iter"<::iterator it=bytime.begin(); it!=bytime.end(); ++it) { + for (std::vector::iterator it = bytime.begin(); it != bytime.end(); ++it) { VlcTest* testp = *it; if (!testp->rank()) { vluint64_t remain = testp->buckets().dataPopCount(remaining); @@ -145,13 +145,13 @@ void VlcTop::annotateCalc() { const VlcPoint& point = m_points.pointNumber(it->second); string filename = point.filename(); int lineno = point.lineno(); - if (!filename.empty() && lineno!=0) { + if (!filename.empty() && lineno != 0) { int column = point.column(); VlcSource& source = sources().findNewSource(filename); string threshStr = point.thresh(); unsigned thresh = (!threshStr.empty()) ? atoi(threshStr.c_str()) : opt.annotateMin(); bool ok = (point.count() >= thresh); - UINFO(9, "AnnoCalc count "<second; - //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; if (!source.needed()) continue; string filename = source.name(); - string outfilename = dirname+"/"+V3Os::filenameNonDir(filename); + string outfilename = dirname + "/" + V3Os::filenameNonDir(filename); - UINFO(1,"annotateOutputFile "< "< " << outfilename << endl); std::ifstream is(filename.c_str()); if (!is) { - v3error("Can't read "<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 "<