Internals: cpplint cleanups. No functional change.

This commit is contained in:
Wilson Snyder 2022-01-08 12:01:39 -05:00
parent 441ecfedc9
commit 15b32dc140
32 changed files with 67 additions and 37 deletions

View File

@ -180,7 +180,7 @@ public:
}
// Internal class access
inline VerilatedFst* spTrace() { return &m_sptrace; };
inline VerilatedFst* spTrace() { return &m_sptrace; }
};
#endif // guard

View File

@ -849,8 +849,8 @@ template <class T_Value, std::size_t T_Depth> struct VlUnpacked final {
WData* data() { return &m_storage[0]; }
const WData* data() const { return &m_storage[0]; }
T_Value& operator[](size_t index) { return m_storage[index]; };
const T_Value& operator[](size_t index) const { return m_storage[index]; };
T_Value& operator[](size_t index) { return m_storage[index]; }
const T_Value& operator[](size_t index) const { return m_storage[index]; }
// Dumping. Verilog: str = $sformatf("%p", assoc)
std::string to_string() const {

View File

@ -1697,7 +1697,7 @@ void vl_get_value(const VerilatedVar* varp, void* varDatap, p_vpi_value valuep,
// Maximum required size is for binary string, one byte per bit plus null termination
static VL_THREAD_LOCAL char t_outStr[VL_VALUE_STRING_MAX_WORDS * VL_EDATASIZE + 1];
// cppcheck-suppress variableScope
const static VL_THREAD_LOCAL int t_outStrSz = sizeof(t_outStr) - 1;
static const VL_THREAD_LOCAL int t_outStrSz = sizeof(t_outStr) - 1;
// We used to presume vpiValue.format = vpiIntVal or if single bit vpiScalarVal
// This may cause backward compatibility issues with older code.
if (valuep->format == vpiVectorVal) {

View File

@ -163,9 +163,9 @@ public:
LatchDetectGraphVertex* outVertexp;
if (!nodep->varp()->user1p()) { // Not seen this output before
outVertexp = addOutputVertex(nodep);
} else
} else {
outVertexp = castVertexp(nodep->varp()->user1p());
}
new V3GraphEdge(this, m_curVertexp, outVertexp, 1);
}
// Run latchCheckInternal on each variable assigned by the always block to see if all control

View File

@ -27,8 +27,12 @@
#include "V3Broken.h"
#include <cmath>
#include <map>
#include <set>
#include <type_traits>
#include <unordered_set>
#include <utility>
#include <vector>
#include "V3Ast__gen_classes.h" // From ./astgen
// Things like:

View File

@ -225,7 +225,7 @@ private:
while (nodep) {
processAndIterate(nodep);
nodep = nodep->nextp();
};
}
}
void pushLocalScope() {
if (m_cfuncp) m_localsStack.emplace_back();

View File

@ -118,7 +118,7 @@ public:
rootFuncp->addStmtsp(callp);
}
}
};
}
private:
VL_UNCOPYABLE(V3CCtorsBuilder);

View File

@ -951,8 +951,9 @@ private:
} else if (VN_IS(nodep->rhsp(), And)) {
andp = VN_AS(nodep->rhsp(), And);
ap = nodep->lhsp();
} else
} else {
return false;
}
const AstNodeUniop* notp;
AstNode* cp;
if (VN_IS(andp->lhsp(), Not)) {

View File

@ -79,8 +79,9 @@ void EmitCFunc::emitOpName(AstNode* nodep, const string& format, AstNode* lhsp,
if (needComma) {
if (pos[1] == ' ') {
nextComma = ", ";
} else
} else {
nextComma = ",";
}
needComma = false;
}
if (pos[1] == ' ') ++pos; // Must do even if no nextComma

View File

@ -37,7 +37,8 @@
// FileLineSingleton class functions
string FileLineSingleton::filenameLetters(int fileno) {
const int size = 1 + (64 / 4); // Each letter retires more than 4 bits of a > 64 bit number
constexpr int size
= 1 + (64 / 4); // Each letter retires more than 4 bits of a > 64 bit number
char out[size];
char* op = out + size - 1;
*--op = '\0'; // We build backwards

View File

@ -23,6 +23,8 @@
#include "V3Graph.h"
#include <functional>
#include <map>
#include <set>
#include <unordered_map>

View File

@ -29,6 +29,7 @@
#include <set>
#include <string>
#include <utility>
#include <unordered_map>
#include <unordered_set>
#include <vector>

View File

@ -512,9 +512,10 @@ public:
if (it2 != m_scopeAliasMap[samn].end()) {
srcp = it2->second;
continue;
} else
} else {
break;
}
}
UINFO(9, " iiasa: Insert alias se" << lhsp << " (" << lhsp->nodep()->typeName()
<< ") <- se" << srcp << " " << srcp->nodep()
<< endl);
@ -623,9 +624,10 @@ public:
}
break;
}
} else
} else {
break;
}
}
if (!lookupSymp) return nullptr; // Not found
}
} else { // Searching for middle submodule, must be a cell name

View File

@ -23,6 +23,8 @@
#include "V3Error.h"
#include "V3Ast.h"
#include <vector>
//============================================================================
class V3LinkLevel final {

View File

@ -23,6 +23,7 @@
#include "V3Error.h"
#include "V3Hash.h"
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>

View File

@ -99,8 +99,9 @@ void test(const string& lhss, const string& op, const string& rhss, const string
gotnum.opLogAnd(lhnum, rhnum);
} else if (op == "||") {
gotnum.opLogOr(lhnum, rhnum);
} else
} else {
v3fatalSrc("Bad opcode: " << op);
}
UINFO(0, "------- Test:\n"
<< " " << lhnum << " " << op << endl

View File

@ -271,9 +271,10 @@ string V3ParseGrammar::deQuote(FileLine* fileline, string text) {
} else if (isalnum(*cp)) {
fileline->v3error("Unknown escape sequence: \\" << *cp);
break;
} else
} else {
newtext += *cp;
}
}
} else if (*cp == '\\') {
quoted = true;
octal_digits = 0;

View File

@ -26,6 +26,7 @@
#include "V3SymTable.h"
#include <deque>
#include <vector>
//######################################################################
// Symbol table for parsing

View File

@ -24,6 +24,7 @@
#include "V3OrderGraph.h"
#include <list>
#include <unordered_map>
class LogicMTask;
using Vx2MTaskMap = std::unordered_map<const MTaskMoveVertex*, LogicMTask*>;

View File

@ -29,8 +29,9 @@
#include "V3Error.h"
#include <set>
#include <functional>
#include <map>
#include <set>
#include <unordered_map>
//######################################################################

View File

@ -42,6 +42,8 @@
#include <deque>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <vector>
//============================================================================

View File

@ -26,9 +26,11 @@
#include "V3String.h"
#include <cstdarg>
#include <map>
#include <iomanip>
#include <map>
#include <memory>
#include <unordered_set>
#include <vector>
class VSymGraph;
class VSymEnt;

View File

@ -23,6 +23,8 @@
#include "V3Error.h"
#include <vector>
namespace V3TSP {
// Perform a "Traveling Salesman Problem" optimizing sort
// on any type you like -- so long as inherits from TspStateBase.

View File

@ -23,6 +23,7 @@
#include "V3Error.h"
#include "V3Ast.h"
#include <utility>
#include <vector>
//============================================================================

View File

@ -276,13 +276,13 @@ private:
UINFO(4, " COUNTBITS(" << dropop[0] << dropop[1] << dropop[2] << " " << nodep << endl);
AstNode* nonXp = nullptr;
if (!dropop[0])
if (!dropop[0]) {
nonXp = nodep->rhsp();
else if (!dropop[1])
} else if (!dropop[1]) {
nonXp = nodep->thsp();
else if (!dropop[2])
} else if (!dropop[2]) {
nonXp = nodep->fhsp();
else { // Was all X-s
} else { // Was all X-s
UINFO(4, " COUNTBITS('x)->0 " << nodep << endl);
AstConst* const newp = new AstConst(nodep->fileline(), AstConst::BitFalse());
nodep->replaceWith(newp);

View File

@ -21,6 +21,7 @@
#include "verilatedos.h"
#include <map>
#include <utility>
#include <vector>
//********************************************************************

View File

@ -21,6 +21,8 @@
#include <algorithm>
#include <fstream>
#include <string>
#include <vector>
//######################################################################