Internals: clang-format cleanups. No functional change.

This commit is contained in:
Wilson Snyder 2020-03-15 23:20:33 -04:00
parent 92d62a6568
commit c2b49f0174
10 changed files with 66 additions and 64 deletions

View File

@ -32,9 +32,9 @@
class V3CCtors { class V3CCtors {
public: public:
static void cctorsAll(); static void cctorsAll();
private: private:
static void evalAsserts(); static void evalAsserts();
}; };
#endif // Guard #endif // Guard

View File

@ -39,7 +39,8 @@ public:
static void addIgnore(V3ErrorCode code, bool on, const string& filename, int min, int max); static void addIgnore(V3ErrorCode code, bool on, const string& filename, int min, int max);
static void addWaiver(V3ErrorCode code, const string& filename, const string& msg); static void addWaiver(V3ErrorCode code, const string& filename, const string& msg);
static void addInline(FileLine* fl, const string& module, const string& ftask, bool on); static void addInline(FileLine* fl, const string& module, const string& ftask, bool on);
static void addVarAttr(FileLine* fl, const string& module, const string& ftask, const string& signal, AstAttrType type, AstSenTree* nodep); static void addVarAttr(FileLine* fl, const string& module, const string& ftask,
const string& signal, AstAttrType type, AstSenTree* nodep);
static void applyCase(AstCase* nodep); static void applyCase(AstCase* nodep);
static void applyCoverageBlock(AstNodeModule* modulep, AstBegin* nodep); static void applyCoverageBlock(AstNodeModule* modulep, AstBegin* nodep);
static void applyIgnores(FileLine* filelinep); static void applyIgnores(FileLine* filelinep);

View File

@ -38,7 +38,8 @@ protected:
V3EdgeFuncP m_edgeFuncp; // Function that says we follow this edge V3EdgeFuncP m_edgeFuncp; // Function that says we follow this edge
// CONSTRUCTORS // CONSTRUCTORS
GraphAlg(T_Graph* graphp, V3EdgeFuncP edgeFuncp) GraphAlg(T_Graph* graphp, V3EdgeFuncP edgeFuncp)
: m_graphp(graphp), m_edgeFuncp(edgeFuncp) {} : m_graphp(graphp)
, m_edgeFuncp(edgeFuncp) {}
~GraphAlg() {} ~GraphAlg() {}
// METHODS // METHODS
inline bool followEdge(V3GraphEdge* edgep) { inline bool followEdge(V3GraphEdge* edgep) {

View File

@ -55,8 +55,7 @@ class GraphPathChecker : GraphAlg<const V3Graph> {
bool isTransitiveEdge(const V3GraphEdge* edgep); bool isTransitiveEdge(const V3GraphEdge* edgep);
private: private:
bool pathExistsInternal(const V3GraphVertex* ap, bool pathExistsInternal(const V3GraphVertex* ap, const V3GraphVertex* bp,
const V3GraphVertex* bp,
unsigned* costp = NULL); unsigned* costp = NULL);
void initHalfCriticalPaths(GraphWay way, bool checkOnly); void initHalfCriticalPaths(GraphWay way, bool checkOnly);
void incGeneration() { ++m_generation; } void incGeneration() { ++m_generation; }

View File

@ -33,6 +33,7 @@ class V3LinkLevel {
private: private:
static void wrapTopCell(AstNetlist* rootp); static void wrapTopCell(AstNetlist* rootp);
static void wrapTopPackages(AstNetlist* rootp); static void wrapTopPackages(AstNetlist* rootp);
public: public:
static void modSortByLevel(); static void modSortByLevel();
static void wrapTop(AstNetlist* rootp); static void wrapTop(AstNetlist* rootp);

View File

@ -40,6 +40,7 @@ private:
// CONSTRUCTORS // CONSTRUCTORS
VL_UNCOPYABLE(V3Parse); VL_UNCOPYABLE(V3Parse);
public: public:
// We must allow reading multiple files into one parser // We must allow reading multiple files into one parser
V3Parse(AstNetlist* rootp, VInFilter* filterp, V3ParseSym* symp); V3Parse(AstNetlist* rootp, VInFilter* filterp, V3ParseSym* symp);

View File

@ -45,9 +45,14 @@ private:
m_dataSize *= 2; m_dataSize *= 2;
// UINFO(9, "Realloc "<<allocSize()<<" for "<<point<<" "<<cvtToHex(m_datap)<<endl); // UINFO(9, "Realloc "<<allocSize()<<" for "<<point<<" "<<cvtToHex(m_datap)<<endl);
vluint64_t* newp = (vluint64_t*)realloc(m_datap, allocSize()); vluint64_t* newp = (vluint64_t*)realloc(m_datap, allocSize());
if (!newp) { free(m_datap); v3fatal("Out of memory increasing buckets"); } if (!newp) {
free(m_datap);
v3fatal("Out of memory increasing buckets");
}
m_datap = newp; m_datap = newp;
for (vluint64_t i=oldsize; i<m_dataSize; i+=64) m_datap[i/64] = 0; for (vluint64_t i = oldsize; i < m_dataSize; i += 64) {
m_datap[i / 64] = 0;
}
} }
public: public:
@ -113,9 +118,7 @@ public:
} }
void orData(const VlcBuckets& ordata) { void orData(const VlcBuckets& ordata) {
for (vluint64_t i = 0; i < m_dataSize; i++) { for (vluint64_t i = 0; i < m_dataSize; i++) {
if (hits(i) && ordata.hits(i)) { if (hits(i) && ordata.hits(i)) clearHits(i);
clearHits(i);
}
} }
} }
@ -128,7 +131,6 @@ public:
} }
}; };
//###################################################################### //######################################################################
#endif // guard #endif // guard

View File

@ -87,10 +87,10 @@ public:
cout << " Num, TestsCover, Count, Name" << endl; cout << " Num, TestsCover, Count, Name" << endl;
} }
void dump() const { void dump() const {
cout<<" "<<std::setw(8)<<std::setfill('0')<<pointNum() cout << " " << std::setw(8) << std::setfill('0') << pointNum();
<<", "<<std::setw(7)<<std::setfill(' ')<<testsCovering() cout << ", " << std::setw(7) << std::setfill(' ') << testsCovering();
<<", "<<std::setw(7)<<std::setfill(' ')<<count() cout << ", " << std::setw(7) << std::setfill(' ') << count();
<<", \""<<name()<<"\""<<endl; cout << ", \"" << name() << "\"" << endl;
} }
}; };
@ -114,9 +114,7 @@ public:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
VlcPoints() { VlcPoints() : m_numPoints(0) {}
m_numPoints = 0;
}
~VlcPoints() {} ~VlcPoints() {}
// METHODS // METHODS
@ -128,17 +126,14 @@ public:
point.dump(); point.dump();
} }
} }
VlcPoint& pointNumber(vluint64_t num) { VlcPoint& pointNumber(vluint64_t num) { return m_points[num]; }
return m_points[num];
}
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::const_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);
} } else {
else {
pointnum = m_numPoints++; pointnum = m_numPoints++;
VlcPoint point(name, pointnum); VlcPoint point(name, pointnum);
point.countInc(count); point.countInc(count);

View File

@ -78,12 +78,13 @@ public:
void dump(bool bucketsToo) { void dump(bool bucketsToo) {
if (testrun() || computrons() != 0.0) { // currently unused // LCOV_EXCL_LINE if (testrun() || computrons() != 0.0) { // currently unused // LCOV_EXCL_LINE
cout << " " << std::setw(8) << std::setfill('0') << testrun() // LCOV_EXCL_LINE cout << " " << std::setw(8) << std::setfill('0') << testrun() // LCOV_EXCL_LINE
<<", "<<std::setw(7)<<std::setfill(' ')<<computrons()<<","; // LCOV_EXCL_LINE << ", " << std::setw(7) << std::setfill(' ') << computrons()
<< ","; // LCOV_EXCL_LINE
} }
cout<<" "<<std::setw(7)<<std::setfill(' ')<<bucketsCovered() cout << " " << std::setw(7) << std::setfill(' ') << bucketsCovered();
<<", "<<std::setw(7)<<std::setfill(' ')<<rank() cout << ", " << std::setw(7) << std::setfill(' ') << rank();
<<", "<<std::setw(7)<<std::setfill(' ')<<rankPoints() cout << ", " << std::setw(7) << std::setfill(' ') << rankPoints();
<<", \""<<name()<<"\""<<endl; cout << ", \"" << name() << "\"" << endl;
if (bucketsToo) m_buckets.dump(); if (bucketsToo) m_buckets.dump();
} }
}; };
@ -95,6 +96,7 @@ class VlcTests {
public: public:
// TYPES // TYPES
typedef std::vector<VlcTest*> ByName; typedef std::vector<VlcTest*> ByName;
private: private:
// MEMBERS // MEMBERS
ByName m_tests; //< List of all tests ByName m_tests; //< List of all tests