diff --git a/Makefile.in b/Makefile.in index dc14bddfd..b805f4886 100644 --- a/Makefile.in +++ b/Makefile.in @@ -322,12 +322,13 @@ cppcheck: $(CPPCHECK_DEP) $(CPPCHECK) $(CPPCHECK_FLAGS) -DVL_DEBUG=1 -DVL_CPPCHECK=1 -DVL_THREADED=1 $(CPPCHECK_INC) $< CLANGTIDY = clang-tidy -CLANGTIDY_FLAGS = -config='' -checks='-fuchsia-*,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-init-variables' +CLANGTIDY_FLAGS = -config='' \ + -header-filter='.*' \ + -checks='-fuchsia-*,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-init-variables,-cppcoreguidelines-avoid-goto,-modernize-avoid-c-arrays,-readability-magic-numbers,-readability-simplify-boolean-expr,-cppcoreguidelines-macro-usage' \ + CLANGTIDY_DEP = $(subst .h,.h.tidy,$(CPPCHECK_H)) \ $(subst .cpp,.cpp.tidy,$(CPPCHECK_CPP)) CLANGTIDY_DEFS = -DVL_DEBUG=1 -DVL_THREADED=1 -DVL_CPPCHECK=1 -# cppcoreguidelines-avoid-goto modernize-avoid-c-arrays readability-magic-numbers readability-simplify-boolean-expr -# cppcoreguidelines-macro-usage clang-tidy: $(CLANGTIDY_DEP) %.cpp.tidy: %.cpp diff --git a/include/verilated.cpp b/include/verilated.cpp index be9740700..90b5f46c9 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -700,7 +700,8 @@ std::string _vl_vsformat_time(char* tmp, T ld, int timeunit, bool left, size_t w = VL_EXTEND_WQ(b, 0, tmp2, std::numeric_limits::max()); // breaks shifted if (VL_GT_W(w, integer, max64Bit)) { WDataOutP v = VL_ASSIGN_W(b, tmp3, integer); // breaks fracDigitsPow10 - VlWide zero, ten; + VlWide zero; + VlWide ten; VL_ZERO_W(b, zero); VL_EXTEND_WI(b, 0, ten, 10); char buf[128]; // 128B is obviously long enough to represent 128bit integer in decimal @@ -1850,8 +1851,7 @@ VlReadMem::VlReadMem(bool hex, int bits, const std::string& filename, QData star , m_bits{bits} , m_filename(filename) // Need () or GCC 4.8 false warning , m_end{end} - , m_addr{start} - , m_linenum{0} { + , m_addr{start} { m_fp = std::fopen(filename.c_str(), "r"); if (VL_UNLIKELY(!m_fp)) { // We don't report the Verilog source filename as it slow to have to pass it down @@ -1985,8 +1985,7 @@ void VlReadMem::setData(void* valuep, const std::string& rhs) { VlWriteMem::VlWriteMem(bool hex, int bits, const std::string& filename, QData start, QData end) : m_hex{hex} - , m_bits{bits} - , m_addr{0} { + , m_bits{bits} { if (VL_UNLIKELY(start > end)) { VL_FATAL_MT(filename.c_str(), 0, "", "$writemem invalid address range"); return; @@ -2311,7 +2310,7 @@ std::string VerilatedContext::dumpfile() const VL_MT_SAFE_EXCLUDES(m_timeDumpMut return m_dumpfile; } std::string VerilatedContext::dumpfileCheck() const VL_MT_SAFE_EXCLUDES(m_timeDumpMutex) { - const std::string out = dumpfile(); + std::string out = dumpfile(); if (VL_UNLIKELY(out.empty())) { VL_PRINTF_MT("%%Warning: $dumpvar ignored as not proceeded by $dumpfile\n"); return ""; @@ -2809,7 +2808,7 @@ void Verilated::runFlushCallbacks() VL_MT_SAFE { // When running internal code coverage (gcc --coverage, as opposed to // verilator --coverage), dump coverage data to properly cover failing // tests. - VL_GCOV_FLUSH(); + VL_GCOV_DUMP(); } void Verilated::addExitCb(VoidPCb cb, void* datap) VL_MT_SAFE { diff --git a/include/verilated.h b/include/verilated.h index 8943fc523..bed666c7d 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -558,7 +558,8 @@ public: /// releases - contact the authors before production use. void scopesDump() const VL_MT_SAFE; -public: // But for internal use only + // METHODS - public but for internal use only + // Internal: access to implementation class VerilatedContextImp* impp() { return reinterpret_cast(this); } const VerilatedContextImp* impp() const { @@ -884,7 +885,6 @@ public: } #endif -public: // METHODS - INTERNAL USE ONLY (but public due to what uses it) // Internal: Create a new module name by concatenating two strings // Returns pointer to thread-local static data (overwritten on next call) diff --git a/include/verilated_cov.cpp b/include/verilated_cov.cpp index d6f03a7f8..6c0f72340 100644 --- a/include/verilated_cov.cpp +++ b/include/verilated_cov.cpp @@ -205,7 +205,7 @@ private: // Forward to . so we have a whole word const std::string suffix = *bpost ? std::string{bpost + 1} : ""; - const std::string out = prefix + "*" + suffix; + std::string out = prefix + "*" + suffix; // cout << "\nch pre="<(nodep)); } // METHODS virtual bool same(const AstNode*) const override { return true; } }; @@ -2556,7 +2556,7 @@ public: AstNode* bodysp() const { return op4p(); } // op4 = body of loop virtual bool isGateOptimizable() const override { return false; } virtual int instrCount() const override { return INSTR_COUNT_BRANCH; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstNodeIf VL_NOT_FINAL : public AstNodeStmt { @@ -2583,7 +2583,7 @@ public: virtual bool isGateOptimizable() const override { return false; } virtual bool isGateDedupable() const override { return true; } virtual int instrCount() const override { return INSTR_COUNT_BRANCH; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } void branchPred(VBranchPred flag) { m_branchPred = flag; } VBranchPred branchPred() const { return m_branchPred; } void isBoundsCheck(bool flag) { m_isBoundsCheck = flag; } diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index 5028e6894..af560f87d 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -189,7 +189,7 @@ public: explicit AstEmpty(FileLine* fl) : ASTGEN_SUPER_Empty(fl) {} ASTNODE_NODE_FUNCS(Empty) - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstEmptyQueue final : public AstNodeMath { @@ -199,7 +199,7 @@ public: ASTNODE_NODE_FUNCS(EmptyQueue) virtual string emitC() override { V3ERROR_NA_RETURN(""); } virtual string emitVerilog() override { return "{}"; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } virtual bool cleanOut() const override { return true; } }; @@ -246,7 +246,7 @@ public: bool littleEndian() const { return leftConst() < rightConst(); } virtual void dump(std::ostream& str) const override; virtual string emitC() { V3ERROR_NA_RETURN(""); } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstBracketRange final : public AstNodeRange { @@ -260,7 +260,7 @@ public: ASTNODE_NODE_FUNCS(BracketRange) virtual string emitC() { V3ERROR_NA_RETURN(""); } virtual string emitVerilog() { V3ERROR_NA_RETURN(""); } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } // Will be removed in V3Width, which relies on this // being a child not a dtype pointed node virtual bool maybePointedTo() const override { return false; } @@ -275,7 +275,7 @@ public: ASTNODE_NODE_FUNCS(UnsizedRange) virtual string emitC() { V3ERROR_NA_RETURN(""); } virtual string emitVerilog() { return "[]"; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstWildcardRange final : public AstNodeRange { @@ -286,7 +286,7 @@ public: ASTNODE_NODE_FUNCS(WildcardRange) virtual string emitC() { V3ERROR_NA_RETURN(""); } virtual string emitVerilog() { return "[*]"; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstGatePin final : public AstNodeMath { @@ -660,7 +660,7 @@ class AstDynArrayDType final : public AstNodeDType { // Dynamic array data type, ie "[]" // Children: DTYPE (moved to refDTypep() in V3Width) private: - AstNodeDType* m_refDTypep; // Elements of this type (after widthing) + AstNodeDType* m_refDTypep = nullptr; // Elements of this type (after widthing) public: AstDynArrayDType(FileLine* fl, VFlagChildDType, AstNodeDType* dtp) : ASTGEN_SUPER_DynArrayDType(fl) { @@ -1043,7 +1043,7 @@ class AstConstDType final : public AstNodeDType { // ConstDType are removed in V3LinkLValue and become AstVar::isConst. // When more generic types are supported AstConstDType will be propagated further. private: - AstNodeDType* m_refDTypep; // Inherit from this base data type + AstNodeDType* m_refDTypep = nullptr; // Inherit from this base data type public: AstConstDType(FileLine* fl, VFlagChildDType, AstNodeDType* dtp) : ASTGEN_SUPER_ConstDType(fl) { @@ -1202,7 +1202,7 @@ class AstQueueDType final : public AstNodeDType { // Queue array data type, ie "[ $ ]" // Children: DTYPE (moved to refDTypep() in V3Width) private: - AstNodeDType* m_refDTypep; // Elements of this type (after widthing) + AstNodeDType* m_refDTypep = nullptr; // Elements of this type (after widthing) public: AstQueueDType(FileLine* fl, VFlagChildDType, AstNodeDType* dtp, AstNode* boundp) : ASTGEN_SUPER_QueueDType(fl) { @@ -1396,7 +1396,7 @@ class AstMemberDType final : public AstNodeDType { // A member of a struct/union // PARENT: AstNodeUOrStructDType private: - AstNodeDType* m_refDTypep; // Elements of this type (after widthing) + AstNodeDType* m_refDTypep = nullptr; // Elements of this type (after widthing) string m_name; // Name of variable string m_tag; // Holds the string of the verilator tag -- used in XML output. int m_lsb = -1; // Within this level's packed struct, the LSB of the first bit of the member @@ -1585,8 +1585,8 @@ class AstEnumDType final : public AstNodeDType { // Children: ENUMVALUEs private: string m_name; // Name from upper typedef, if any - AstNodeDType* m_refDTypep; // Elements are of this type after V3Width - const int m_uniqueNum; + AstNodeDType* m_refDTypep = nullptr; // Elements are of this type after V3Width + const int m_uniqueNum = 0; public: AstEnumDType(FileLine* fl, VFlagChildDType, AstNodeDType* dtp, AstNode* itemsp) @@ -1709,7 +1709,7 @@ public: return true; } // esp for V3Const::ifSameAssign virtual bool isPredictOptimizable() const override { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } virtual int instrCount() const override { return widthInstrs(); } // Special operators // Return base var (or const) nodep dereferences @@ -1750,7 +1750,7 @@ public: return true; } // esp for V3Const::ifSameAssign virtual bool isPredictOptimizable() const override { return false; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } virtual int instrCount() const override { return widthInstrs(); } }; @@ -1788,7 +1788,7 @@ public: return true; } // esp for V3Const::ifSameAssign virtual bool isPredictOptimizable() const override { return false; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } virtual int instrCount() const override { return widthInstrs(); } }; @@ -1815,7 +1815,7 @@ public: virtual bool cleanRhs() const override { return true; } virtual bool sizeMattersLhs() const override { return false; } virtual bool sizeMattersRhs() const override { return false; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstSelLoopVars final : public AstNode { @@ -1828,7 +1828,7 @@ public: addNOp2p(elementsp); } ASTNODE_NODE_FUNCS(SelLoopVars) - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } virtual bool maybePointedTo() const override { return false; } AstNode* fromp() const { return op1p(); } void fromp(AstNode* nodep) { setOp1p(nodep); } @@ -3358,7 +3358,7 @@ public: addNOp2p(exprp); } ASTNODE_NODE_FUNCS(WithParse) - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } // AstNode* funcrefp() const { return op1p(); } AstNode* exprp() const { return op2p(); } @@ -3378,7 +3378,7 @@ public: , m_name{name} , m_index(index) {} ASTNODE_NODE_FUNCS(LambdaArgRef) - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } virtual string emitVerilog() override { return name(); } virtual string emitC() override { V3ERROR_NA_RETURN(""); } virtual bool cleanOut() const override { return true; } @@ -3405,7 +3405,7 @@ public: addNOp3p(exprp); } ASTNODE_NODE_FUNCS(With) - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } virtual bool hasDType() const override { return true; } virtual const char* broken() const override { BROKEN_RTN(!indexArgRefp()); // varp needed to know lambda's arg dtype @@ -3585,7 +3585,7 @@ public: addNOp2p(bodysp); } ASTNODE_NODE_FUNCS(AlwaysPublic) - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } // AstSenTree* sensesp() const { return VN_AS(op1p(), SenTree); } // op1 = Sensitivity list AstNode* bodysp() const { return op2p(); } // op2 = Statements to evaluate @@ -3919,7 +3919,7 @@ public: } ASTNODE_NODE_FUNCS(CoverToggle) virtual int instrCount() const override { return 3 + INSTR_COUNT_BRANCH + INSTR_COUNT_LD; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } virtual bool isGateOptimizable() const override { return false; } virtual bool isPredictOptimizable() const override { return true; } virtual bool isOutputter() const override { @@ -3941,7 +3941,7 @@ public: setNOp2p(stmtsp); } ASTNODE_NODE_FUNCS(Delay) - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } // AstNode* lhsp() const { return op1p(); } // op1 = delay value void lhsp(AstNode* nodep) { setOp1p(nodep); } @@ -4147,7 +4147,7 @@ public: virtual bool isPredictOptimizable() const override { return false; } virtual bool isOutputter() const override { return true; } virtual bool cleanOut() const { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } VDumpCtlType ctlType() const { return m_ctlType; } AstNode* exprp() const { return op1p(); } // op2 = Expressions to output void exprp(AstNode* nodep) { setOp1p(nodep); } @@ -4218,7 +4218,7 @@ public: virtual bool isOutputter() const override { return false; } virtual bool cleanOut() const { return false; } virtual int instrCount() const override { return INSTR_COUNT_PLI; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } void fmtp(AstSFormatF* nodep) { addOp1p(nodep); } // op1 = To-String formatter AstSFormatF* fmtp() const { return VN_AS(op1p(), SFormatF); } AstNode* lhsp() const { return op3p(); } @@ -4241,7 +4241,7 @@ public: virtual bool isPure() const override { return true; } virtual bool isOutputter() const override { return false; } virtual int instrCount() const override { return 0; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } AstNode* lhsp() const { return op1p(); } // op1 = Expressions to eval void lhsp(AstNode* nodep) { addOp1p(nodep); } // op1 = Expressions to eval }; @@ -4282,7 +4282,7 @@ public: virtual bool isPure() const override { return false; } virtual bool isOutputter() const override { return true; } virtual bool isUnlikely() const override { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } AstNode* filep() const { return op2p(); } void filep(AstNodeVarRef* nodep) { setNOp2p(nodep); } }; @@ -4303,7 +4303,7 @@ public: virtual bool isPure() const override { return false; } virtual bool isOutputter() const override { return true; } virtual bool isUnlikely() const override { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } AstNode* filep() const { return op1p(); } AstNode* filenamep() const { return op2p(); } AstNode* modep() const { return op3p(); } @@ -4324,7 +4324,7 @@ public: virtual bool isPure() const override { return false; } virtual bool isOutputter() const override { return true; } virtual bool isUnlikely() const override { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } AstNode* filep() const { return op1p(); } AstNode* filenamep() const { return op2p(); } }; @@ -4344,7 +4344,7 @@ public: virtual bool isPure() const override { return false; } virtual bool isOutputter() const override { return true; } virtual bool isUnlikely() const override { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } AstNode* filep() const { return op2p(); } void filep(AstNodeVarRef* nodep) { setNOp2p(nodep); } }; @@ -4372,7 +4372,7 @@ public: virtual bool isPure() const override { return false; } // SPECIAL: has 'visual' ordering virtual bool isOutputter() const override { return true; } // SPECIAL: makes output virtual bool cleanOut() const override { return false; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } AstNode* memp() const { return op1p(); } void memp(AstNode* nodep) { setOp1p(nodep); } AstNode* filep() const { return op2p(); } @@ -4401,7 +4401,7 @@ public: virtual bool isOutputter() const override { return true; } virtual bool isUnlikely() const override { return true; } virtual bool cleanOut() const override { return false; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } AstNode* filep() const { return op2p(); } void filep(AstNodeVarRef* nodep) { setNOp2p(nodep); } }; @@ -4424,7 +4424,7 @@ public: virtual bool isOutputter() const override { return true; } virtual bool isUnlikely() const override { return true; } virtual bool cleanOut() const override { return false; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } AstNode* filep() const { return op2p(); } void filep(AstNodeVarRef* nodep) { setNOp2p(nodep); } }; @@ -4450,7 +4450,7 @@ public: virtual bool isPure() const override { return false; } // SPECIAL: has 'visual' ordering virtual bool isOutputter() const override { return true; } // SPECIAL: makes output virtual bool cleanOut() const override { return false; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } AstNode* filep() const { return op2p(); } void filep(AstNode* nodep) { setOp2p(nodep); } AstNode* offset() const { return op3p(); } @@ -4614,7 +4614,7 @@ public: virtual bool isPure() const override { return false; } virtual bool isOutputter() const override { return true; } virtual bool isUnlikely() const override { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } AstNode* lhsp() const { return op1p(); } }; @@ -4635,7 +4635,7 @@ public: virtual bool isOutputter() const override { return true; } virtual bool isUnlikely() const override { return true; } virtual bool cleanOut() const override { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } AstNode* lhsp() const { return op1p(); } }; @@ -4656,7 +4656,7 @@ public: virtual bool isPredictOptimizable() const override { return false; } virtual bool isPure() const override { return !outp(); } virtual bool cleanOut() const override { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } AstNode* searchp() const { return op1p(); } // op1 = Search expression void searchp(AstNode* nodep) { setOp1p(nodep); } AstNode* outp() const { return op2p(); } // op2 = Expressions to output @@ -4678,7 +4678,7 @@ public: virtual bool isGateOptimizable() const override { return false; } virtual bool isPredictOptimizable() const override { return false; } virtual bool cleanOut() const override { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } AstNode* searchp() const { return op1p(); } // op1 = Search expression void searchp(AstNode* nodep) { setOp1p(nodep); } }; @@ -4702,7 +4702,7 @@ public: AstNode* bodysp() const { return op4p(); } // op4 = body of loop virtual bool isGateOptimizable() const override { return false; } virtual int instrCount() const override { return INSTR_COUNT_BRANCH; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstRepeat final : public AstNodeStmt { @@ -4719,7 +4719,7 @@ public: return false; } // Not relevant - converted to FOR virtual int instrCount() const override { return INSTR_COUNT_BRANCH; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstWait final : public AstNodeStmt { @@ -4752,7 +4752,7 @@ public: void addIncsp(AstNode* newp) { addOp4p(newp); } virtual bool isGateOptimizable() const override { return false; } virtual int instrCount() const override { return INSTR_COUNT_BRANCH; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } // Stop statement searchback here virtual void addBeforeStmt(AstNode* newp, AstNode* belowp) override; // Stop statement searchback here @@ -4872,7 +4872,7 @@ public: ASTNODE_NODE_FUNCS(JumpBlock) virtual int instrCount() const override { return 0; } virtual bool maybePointedTo() const override { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } // op1 = Statements AstNode* stmtsp() const { return op1p(); } // op1 = List of statements void addStmtsp(AstNode* nodep) { addNOp1p(nodep); } @@ -4959,7 +4959,7 @@ public: virtual bool cleanOut() const override { return true; } virtual int instrCount() const override { return widthInstrs(); } AstNode* defaultp() const { return op1p(); } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstSetAssoc final : public AstNodeMath { // Set an assoc array element and return object, '{} @@ -4981,7 +4981,7 @@ public: AstNode* lhsp() const { return op1p(); } AstNode* keyp() const { return op2p(); } AstNode* valuep() const { return op3p(); } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstConsWildcard final : public AstNodeMath { @@ -5000,7 +5000,7 @@ public: virtual bool cleanOut() const override { return true; } virtual int instrCount() const override { return widthInstrs(); } AstNode* defaultp() const { return op1p(); } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstSetWildcard final : public AstNodeMath { // Set a wildcard assoc array element and return object, '{} @@ -5022,7 +5022,7 @@ public: AstNode* lhsp() const { return op1p(); } AstNode* keyp() const { return op2p(); } AstNode* valuep() const { return op3p(); } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstConsDynArray final : public AstNodeMath { @@ -5043,7 +5043,7 @@ public: virtual int instrCount() const override { return widthInstrs(); } AstNode* lhsp() const { return op1p(); } // op1 = expression AstNode* rhsp() const { return op2p(); } // op2 = expression - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstConsQueue final : public AstNodeMath { @@ -5064,7 +5064,7 @@ public: virtual int instrCount() const override { return widthInstrs(); } AstNode* lhsp() const { return op1p(); } // op1 = expression AstNode* rhsp() const { return op2p(); } // op2 = expression - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstBegin final : public AstNodeBlock { @@ -5241,7 +5241,7 @@ public: : ASTGEN_SUPER_New(fl, false, "new", pinsp) {} ASTNODE_NODE_FUNCS(New) virtual bool cleanOut() const { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } virtual bool hasDType() const override { return true; } virtual int instrCount() const override { return widthInstrs(); } }; @@ -5260,7 +5260,7 @@ public: virtual string emitVerilog() override { return "new"; } virtual string emitC() override { V3ERROR_NA_RETURN(""); } virtual bool cleanOut() const override { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } virtual int instrCount() const override { return widthInstrs(); } AstNode* rhsp() const { return op1p(); } }; @@ -5280,7 +5280,7 @@ public: virtual string emitVerilog() override { return "new"; } virtual string emitC() override { V3ERROR_NA_RETURN(""); } virtual bool cleanOut() const override { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } virtual int instrCount() const override { return widthInstrs(); } AstNode* sizep() const { return op1p(); } AstNode* rhsp() const { return op2p(); } @@ -5709,7 +5709,7 @@ public: virtual bool isGateOptimizable() const override { return false; } virtual bool isPredictOptimizable() const override { return false; } virtual int instrCount() const override { return INSTR_COUNT_PLI; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } bool combinable(const AstRand* samep) const { return !seedp() && !samep->seedp() && reset() == samep->reset() && urandom() == samep->urandom(); @@ -5760,7 +5760,7 @@ public: virtual bool isGateOptimizable() const override { return false; } virtual bool isPredictOptimizable() const override { return false; } virtual int instrCount() const override { return INSTR_COUNT_TIME; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } virtual void dump(std::ostream& str = std::cout) const override; void timeunit(const VTimescale& flag) { m_timeunit = flag; } VTimescale timeunit() const { return m_timeunit; } @@ -5781,7 +5781,7 @@ public: virtual bool isGateOptimizable() const override { return false; } virtual bool isPredictOptimizable() const override { return false; } virtual int instrCount() const override { return INSTR_COUNT_TIME; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } virtual void dump(std::ostream& str = std::cout) const override; void timeunit(const VTimescale& flag) { m_timeunit = flag; } VTimescale timeunit() const { return m_timeunit; } @@ -5806,7 +5806,7 @@ public: virtual bool isSubstOptimizable() const override { return false; } virtual bool isPredictOptimizable() const override { return false; } virtual int instrCount() const override { return INSTR_COUNT_PLI; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; //====================================================================== @@ -6394,7 +6394,7 @@ public: virtual bool cleanOut() const override { return true; } virtual bool cleanLhs() const override { return true; } virtual bool sizeMattersLhs() const override { return false; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstFEof final : public AstNodeUniop { @@ -6436,7 +6436,7 @@ public: AstNode* filep() const { return op1p(); } void strp(AstNode* nodep) { setOp2p(nodep); } AstNode* strp() const { return op2p(); } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstFGetC final : public AstNodeUniop { @@ -8561,7 +8561,7 @@ public: AstNode* exprp() const { return op1p(); } // op1 = expression AstSenTree* sentreep() const { return VN_AS(op2p(), SenTree); } // op2 = clock domain void sentreep(AstSenTree* sentreep) { addOp2p(sentreep); } // op2 = clock domain - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstPast final : public AstNodeMath { @@ -8584,7 +8584,7 @@ public: AstNode* ticksp() const { return op2p(); } // op2 = ticks or nullptr means 1 AstSenTree* sentreep() const { return VN_AS(op4p(), SenTree); } // op4 = clock domain void sentreep(AstSenTree* sentreep) { addOp4p(sentreep); } // op4 = clock domain - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstRose final : public AstNodeMath { @@ -8605,7 +8605,7 @@ public: AstNode* exprp() const { return op1p(); } // op1 = expression AstSenTree* sentreep() const { return VN_AS(op2p(), SenTree); } // op2 = clock domain void sentreep(AstSenTree* sentreep) { addOp2p(sentreep); } // op2 = clock domain - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstSampled final : public AstNodeMath { @@ -8624,7 +8624,7 @@ public: virtual bool cleanOut() const override { V3ERROR_NA_RETURN(""); } virtual int instrCount() const override { return 0; } AstNode* exprp() const { return op1p(); } // op1 = expression - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstStable final : public AstNodeMath { @@ -8645,7 +8645,7 @@ public: AstNode* exprp() const { return op1p(); } // op1 = expression AstSenTree* sentreep() const { return VN_AS(op2p(), SenTree); } // op2 = clock domain void sentreep(AstSenTree* sentreep) { addOp2p(sentreep); } // op2 = clock domain - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; class AstPattern final : public AstNodeMath { @@ -8720,7 +8720,7 @@ public: void rhsp(AstNode* nodep) { return setOp2p(nodep); } AstSenTree* sentreep() const { return VN_AS(op4p(), SenTree); } // op4 = clock domain void sentreep(AstSenTree* sentreep) { addOp4p(sentreep); } // op4 = clock domain - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; //====================================================================== @@ -8941,7 +8941,7 @@ public: virtual bool isPredictOptimizable() const override { return false; } virtual bool isPure() const override { return false; } virtual bool isOutputter() const override { return true; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } }; //====================================================================== @@ -8961,7 +8961,7 @@ public: ASTNODE_BASE_FUNCS(NodeFile) virtual void dump(std::ostream& str) const override; virtual string name() const override { return m_name; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } void tblockp(AstTextBlock* tblockp) { setOp1p(tblockp); } AstTextBlock* tblockp() { return VN_AS(op1p(), TextBlock); } }; @@ -9225,7 +9225,7 @@ public: } ASTNODE_NODE_FUNCS(CReturn) virtual int instrCount() const override { return widthInstrs(); } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } // AstNode* lhsp() const { return op1p(); } }; @@ -9256,7 +9256,7 @@ public: virtual bool cleanOut() const override { return m_cleanOut; } virtual string emitVerilog() override { V3ERROR_NA_RETURN(""); } virtual string emitC() override { V3ERROR_NA_RETURN(""); } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } void addBodysp(AstNode* nodep) { addNOp1p(nodep); } AstNode* bodysp() const { return op1p(); } // op1 = expressions to print bool pure() const { return m_pure; } @@ -9273,7 +9273,7 @@ public: ASTNODE_NODE_FUNCS(CReset) virtual bool isGateOptimizable() const override { return false; } virtual bool isPredictOptimizable() const override { return false; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } AstVarRef* varrefp() const { return VN_AS(op1p(), VarRef); } // op1 = varref to reset }; @@ -9291,7 +9291,7 @@ public: ASTNODE_NODE_FUNCS(CStmt) virtual bool isGateOptimizable() const override { return false; } virtual bool isPredictOptimizable() const override { return false; } - virtual bool same(const AstNode* samep) const override { return true; } + virtual bool same(const AstNode* /*samep*/) const override { return true; } void addBodysp(AstNode* nodep) { addNOp1p(nodep); } AstNode* bodysp() const { return op1p(); } // op1 = expressions to print }; @@ -9387,7 +9387,7 @@ class AstTypeTable final : public AstNode { AstEmptyQueueDType* m_emptyQueuep = nullptr; AstQueueDType* m_queueIndexp = nullptr; AstVoidDType* m_voidp = nullptr; - AstBasicDType* m_basicps[VBasicDTypeKwd::_ENUM_MAX]; + AstBasicDType* m_basicps[VBasicDTypeKwd::_ENUM_MAX]{}; // using DetailedMap = std::map; DetailedMap m_detailedMap; diff --git a/src/V3Dead.cpp b/src/V3Dead.cpp index 243c580bf..f64a24453 100644 --- a/src/V3Dead.cpp +++ b/src/V3Dead.cpp @@ -85,7 +85,7 @@ private: } if (AstNode* const subnodep = nodep->getChildDTypep()) subnodep->user1Inc(); } - void checkVarRef(AstNodeVarRef* nodep) { + void checkVarRef(AstNodeVarRef* nodep) const { if (nodep->classOrPackagep() && m_elimCells) nodep->classOrPackagep(nullptr); } void checkDType(AstNodeDType* nodep) { @@ -316,7 +316,7 @@ private: } } } - bool mightElimVar(AstVar* nodep) { + bool mightElimVar(AstVar* nodep) const { if (nodep->isSigPublic()) return false; // Can't elim publics! if (nodep->isIO() || nodep->isClassMember()) return false; if (nodep->isTemp() && !nodep->isTrace()) return true; diff --git a/src/V3DupFinder.h b/src/V3DupFinder.h index ed8d13097..1ee51a992 100644 --- a/src/V3DupFinder.h +++ b/src/V3DupFinder.h @@ -44,7 +44,7 @@ class V3DupFinder final : private std::multimap { using Super = std::multimap; // MEMBERS - const V3Hasher* const m_hasherp; // Pointer to owned hasher + const V3Hasher* const m_hasherp = nullptr; // Pointer to owned hasher const V3Hasher& m_hasher; // Reference to hasher public: @@ -53,8 +53,7 @@ public: : m_hasherp{new V3Hasher} , m_hasher{*m_hasherp} {} explicit V3DupFinder(const V3Hasher& hasher) - : m_hasherp{nullptr} - , m_hasher{hasher} {} + : m_hasher{hasher} {} ~V3DupFinder() { if (m_hasherp) delete m_hasherp; } diff --git a/src/V3Error.cpp b/src/V3Error.cpp index 1f1f8d08f..f032e7c06 100644 --- a/src/V3Error.cpp +++ b/src/V3Error.cpp @@ -167,7 +167,7 @@ void V3Error::vlAbortOrExit() { } void V3Error::vlAbort() { - VL_GCOV_FLUSH(); + VL_GCOV_DUMP(); std::abort(); } diff --git a/src/V3FileLine.cpp b/src/V3FileLine.cpp index 016329fc7..d82c8966e 100644 --- a/src/V3FileLine.cpp +++ b/src/V3FileLine.cpp @@ -126,7 +126,7 @@ string VFileContent::getLine(int lineno) const { return ""; } } - const string text = m_lines[lineno]; + string text = m_lines[lineno]; UINFO(9, "Get Stream[ct" << m_id << "+" << lineno << "]: " << text); return text; } diff --git a/src/V3FileLine.h b/src/V3FileLine.h index 328b682cd..d49d5e44a 100644 --- a/src/V3FileLine.h +++ b/src/V3FileLine.h @@ -162,7 +162,7 @@ public: m_firstColumn = firstColumn; m_lastColumn = lastColumn; } - void language(V3LangCode lang) { singleton().numberToLang(filenameno(), lang); } + void language(V3LangCode lang) const { singleton().numberToLang(filenameno(), lang); } void filename(const string& name) { m_filenameno = singleton().nameToNumber(name); } void parent(FileLine* fileline) { m_parent = fileline; } void lineDirective(const char* textp, int& enterExitRef); @@ -213,7 +213,7 @@ public: void warnStyleOff(bool flag); void warnStateFrom(const FileLine& from) { m_warnOn = from.m_warnOn; } void warnResetDefault() { warnStateFrom(defaultFileLine()); } - bool lastWarnWaived() { return m_waive; } + bool lastWarnWaived() const { return m_waive; } // Specific flag ACCESSORS/METHODS bool celldefineOn() const { return m_warnOn.test(V3ErrorCode::I_CELLDEFINE); } diff --git a/src/V3HierBlock.cpp b/src/V3HierBlock.cpp index 22006fa23..2430e19db 100644 --- a/src/V3HierBlock.cpp +++ b/src/V3HierBlock.cpp @@ -201,7 +201,7 @@ string V3HierBlock::hierGenerated(bool withDir) const { } string V3HierBlock::vFileIfNecessary() const { - const string filename = V3Os::filenameRealPath(m_modp->fileline()->filename()); + string filename = V3Os::filenameRealPath(m_modp->fileline()->filename()); for (const string& v : v3Global.opt.vFiles()) { // Already listed in vFiles, so no need to add the file. if (filename == V3Os::filenameRealPath(v)) return ""; diff --git a/src/V3Options.cpp b/src/V3Options.cpp index de4428b02..cb9720fbd 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -339,7 +339,7 @@ bool V3Options::hasParameter(const string& name) { } string V3Options::parameter(const string& name) { - const string value = m_parameters.find(name)->second; + string value = m_parameters.find(name)->second; m_parameters.erase(m_parameters.find(name)); return value; } @@ -477,7 +477,7 @@ string V3Options::fileExists(const string& filename) { return ""; // Not found } // Check if it is a directory, ignore if so - const string filenameOut = V3Os::filenameFromDirBase(dir, basename); + string filenameOut = V3Os::filenameFromDirBase(dir, basename); if (!fileStatNormal(filenameOut)) return ""; // Directory return filenameOut; } @@ -518,11 +518,11 @@ string V3Options::filePath(FileLine* fl, const string& modname, const string& la // using the incdir and libext's. // Return "" if not found. for (const string& dir : m_impp->m_incDirUsers) { - const string exists = filePathCheckOneDir(modname, dir); + string exists = filePathCheckOneDir(modname, dir); if (exists != "") return exists; } for (const string& dir : m_impp->m_incDirFallbacks) { - const string exists = filePathCheckOneDir(modname, dir); + string exists = filePathCheckOneDir(modname, dir); if (exists != "") return exists; } diff --git a/src/V3ParseGrammar.cpp b/src/V3ParseGrammar.cpp index f2d57f289..38bae0374 100644 --- a/src/V3ParseGrammar.cpp +++ b/src/V3ParseGrammar.cpp @@ -270,7 +270,8 @@ string V3ParseGrammar::deQuote(FileLine* fileline, string text) { } else if (*cp == 'x' && isxdigit(cp[1]) && isxdigit(cp[2])) { // SystemVerilog 3.1 #define vl_decodexdigit(c) ((isdigit(c) ? ((c) - '0') : (tolower((c)) - 'a' + 10))) - newtext += (char)(16 * vl_decodexdigit(cp[1]) + vl_decodexdigit(cp[2])); + newtext + += static_cast(16 * vl_decodexdigit(cp[1]) + vl_decodexdigit(cp[2])); cp += 2; } else if (isalnum(*cp)) { fileline->v3error("Unknown escape sequence: \\" << *cp); diff --git a/src/V3ParseImp.h b/src/V3ParseImp.h index 777e205cc..cc1918865 100644 --- a/src/V3ParseImp.h +++ b/src/V3ParseImp.h @@ -173,9 +173,10 @@ public: } static int debug() { static int level = -1; - if (VL_UNLIKELY(level < 0)) + if (VL_UNLIKELY(level < 0)) { level = std::max(std::max(debugBison(), debugFlex()), v3Global.opt.debugSrcLevel("V3ParseImp")); + } return level; } @@ -273,7 +274,7 @@ public: //==== Symbol tables V3ParseSym* symp() { return m_symp; } - AstPackage* unitPackage(FileLine* fl) { + AstPackage* unitPackage(FileLine* /*fl*/) { // Find one made earlier? const VSymEnt* const rootSymp = symp()->symRootp()->findIdFlat(AstPackage::dollarUnitName()); diff --git a/src/V3PartitionGraph.h b/src/V3PartitionGraph.h index 2fba23172..262a2b286 100644 --- a/src/V3PartitionGraph.h +++ b/src/V3PartitionGraph.h @@ -30,7 +30,7 @@ class AbstractMTask VL_NOT_FINAL : public V3GraphVertex { public: - AbstractMTask(V3Graph* graphp) + explicit AbstractMTask(V3Graph* graphp) : V3GraphVertex{graphp} {} virtual ~AbstractMTask() override = default; virtual uint32_t id() const = 0; @@ -42,7 +42,7 @@ public: // TYPES using VxList = std::list; // CONSTRUCTORS - AbstractLogicMTask(V3Graph* graphp) + explicit AbstractLogicMTask(V3Graph* graphp) : AbstractMTask{graphp} {} virtual ~AbstractLogicMTask() override = default; // METHODS diff --git a/src/V3PreProc.cpp b/src/V3PreProc.cpp index 7301d6b1e..7dfeb9c12 100644 --- a/src/V3PreProc.cpp +++ b/src/V3PreProc.cpp @@ -1612,7 +1612,7 @@ string V3PreProcImp::getline() { // Make new string with data up to the newline. const int len = rtnp - m_lineChars.c_str() + 1; - const string theLine(m_lineChars, 0, len); + string theLine(m_lineChars, 0, len); m_lineChars = m_lineChars.erase(0, len); // Remove returned characters if (debug() >= 4) { const string lncln = V3PreLex::cleanDbgStrg(theLine); diff --git a/src/V3Simulate.h b/src/V3Simulate.h index 195139cd2..378cdd0e4 100644 --- a/src/V3Simulate.h +++ b/src/V3Simulate.h @@ -183,7 +183,7 @@ public: } m_whyNotOptimizable = why; std::ostringstream stack; - for (auto& callstack : vlstd::reverse_view(m_callStack)) { + for (const auto& callstack : vlstd::reverse_view(m_callStack)) { AstFuncRef* const funcp = callstack->m_funcp; stack << "\n " << funcp->fileline() << "... Called from " << funcp->prettyName() << "() with parameters:"; @@ -193,9 +193,10 @@ public: AstVar* const portp = conIt->first; AstNode* const pinp = conIt->second->exprp(); AstNodeDType* const dtypep = pinp->dtypep(); - if (AstConst* const valp = fetchConstNull(pinp)) + if (AstConst* const valp = fetchConstNull(pinp)) { stack << "\n " << portp->prettyName() << " = " << prettyNumber(&valp->num(), dtypep); + } } } m_whyNotOptimizable += stack.str(); @@ -380,7 +381,7 @@ private: UASSERT_OBJ(vscp, nodep, "Not linked"); return vscp; } - int unrollCount() { + int unrollCount() const { return m_params ? v3Global.opt.unrollCount() * 16 : v3Global.opt.unrollCount(); } bool jumpingOver(AstNode* nodep) { diff --git a/src/V3TraceDecl.cpp b/src/V3TraceDecl.cpp index 791034307..09c2ac8f5 100644 --- a/src/V3TraceDecl.cpp +++ b/src/V3TraceDecl.cpp @@ -192,7 +192,9 @@ private: m_subFuncSize += stmtp->nodeCount(); } - std::string getScopeChar(VltTraceScope sct) { return std::string(1, (char)(0x80 + sct)); } + std::string getScopeChar(VltTraceScope sct) { + return std::string(1, static_cast(0x80 + sct)); + } std::string addAboveInterface(const std::string& scopeName) { std::string out; diff --git a/src/V3Tristate.cpp b/src/V3Tristate.cpp index 6a9d7f4a8..da76ddb17 100644 --- a/src/V3Tristate.cpp +++ b/src/V3Tristate.cpp @@ -360,7 +360,7 @@ class TristateVisitor final : public TristateBaseVisitor { VDouble0 m_statTriSigs; // stat tracking // METHODS - string dbgState() { + string dbgState() const { string o = (m_graphing ? " gr " : " ng "); if (m_alhs) o += "alhs "; return o; diff --git a/src/V3Unroll.cpp b/src/V3Unroll.cpp index 429708301..769faf369 100644 --- a/src/V3Unroll.cpp +++ b/src/V3Unroll.cpp @@ -58,7 +58,7 @@ private: VL_DEBUG_FUNC; // Declare debug() // VISITORS - bool cantUnroll(AstNode* nodep, const char* reason) { + bool cantUnroll(AstNode* nodep, const char* reason) const { if (m_generate) nodep->v3warn(E_UNSUPPORTED, "Unsupported: Can't unroll generate for; " << reason); UINFO(3, " Can't Unroll: " << reason << " :" << nodep << endl); diff --git a/src/VlcBucket.h b/src/VlcBucket.h index ef5fdcdc7..0160ae1b2 100644 --- a/src/VlcBucket.h +++ b/src/VlcBucket.h @@ -96,20 +96,20 @@ public: } uint64_t popCount() const { uint64_t pop = 0; - for (uint64_t i = 0; i < m_dataSize; i++) { - if (hits(i)) pop++; + for (uint64_t i = 0; i < m_dataSize; ++i) { + if (hits(i)) ++pop; } return pop; } uint64_t dataPopCount(const VlcBuckets& remaining) { uint64_t pop = 0; - for (uint64_t i = 0; i < m_dataSize; i++) { - if (hits(i) && remaining.hits(i)) pop++; + for (uint64_t i = 0; i < m_dataSize; ++i) { + if (hits(i) && remaining.hits(i)) ++pop; } return pop; } void orData(const VlcBuckets& ordata) { - for (uint64_t i = 0; i < m_dataSize; i++) { + for (uint64_t i = 0; i < m_dataSize; ++i) { if (hits(i) && ordata.hits(i)) clearHits(i); } }