diff --git a/include/verilated.cpp b/include/verilated.cpp index 3e35abece..97212fc49 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -255,8 +255,6 @@ Verilated::Serialized::Serialized() { } Verilated::NonSerialized::NonSerialized() { - s_profThreadsStart = 1; - s_profThreadsWindow = 2; s_profThreadsFilenamep = strdup("profile_threads.dat"); } Verilated::NonSerialized::~NonSerialized() { @@ -1759,12 +1757,12 @@ static const char* formatBinary(int nBits, vluint32_t bits) { } VlReadMem::VlReadMem(bool hex, int bits, const std::string& filename, QData start, QData end) - : m_hex(hex) - , m_bits(bits) - , m_filename(filename) - , m_end(end) - , m_addr(start) - , m_linenum(0) { + : m_hex{hex} + , m_bits{bits} + , m_filename{filename} + , m_end{end} + , m_addr{start} + , m_linenum{0} { m_fp = 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 @@ -1895,9 +1893,9 @@ 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_hex{hex} + , m_bits{bits} + , m_addr{0} { if (VL_UNLIKELY(start > end)) { VL_FATAL_MT(filename.c_str(), 0, "", "$writemem invalid address range"); return; @@ -2174,17 +2172,7 @@ void VL_TIMEFORMAT_IINI(int units, int precision, const std::string& suffix, //=========================================================================== // Verilated:: Methods -Verilated::ThreadLocal::ThreadLocal() - : -#ifdef VL_THREADED - t_mtaskId(0) - , t_endOfEvalReqd(0) - , -#endif - t_dpiScopep(nullptr) - , t_dpiFilename(0) - , t_dpiLineno(0) { -} +Verilated::ThreadLocal::ThreadLocal() {} Verilated::ThreadLocal::~ThreadLocal() {} void Verilated::debug(int level) VL_MT_SAFE { @@ -2554,7 +2542,7 @@ VerilatedSyms::~VerilatedSyms() { // VerilatedModule:: Methods VerilatedModule::VerilatedModule(const char* namep) - : m_namep(strdup(namep)) {} + : m_namep{strdup(namep)} {} VerilatedModule::~VerilatedModule() { // Memory cleanup - not called during normal operation @@ -2601,16 +2589,7 @@ void* VerilatedVarProps::datapAdjustIndex(void* datap, int dim, int indx) const //====================================================================== // VerilatedScope:: Methods -VerilatedScope::VerilatedScope() { - m_callbacksp = nullptr; - m_namep = nullptr; - m_identifierp = nullptr; - m_funcnumMax = 0; - m_symsp = nullptr; - m_varsp = nullptr; - m_timeunit = 0; - m_type = SCOPE_OTHER; -} +VerilatedScope::VerilatedScope() {} VerilatedScope::~VerilatedScope() { // Memory cleanup - not called during normal operation diff --git a/include/verilated.h b/include/verilated.h index 70a476ac9..a192fa063 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -163,7 +163,7 @@ private: public: explicit VerilatedLockGuard(VerilatedMutex& mutexr) VL_ACQUIRE(mutexr) - : m_mutexr(mutexr) { + : m_mutexr{mutexr} { m_mutexr.lock(); } ~VerilatedLockGuard() VL_RELEASE() { m_mutexr.unlock(); } @@ -203,7 +203,7 @@ public: /// The constructor establishes the thread id for all later calls. /// If necessary, a different class could be made that inits it otherwise. VerilatedAssertOneThread() - : m_threadid(VL_THREAD_ID()) {} + : m_threadid{VL_THREAD_ID()} {} ~VerilatedAssertOneThread() { check(); } // METHODS /// Check that the current thread ID is the same as the construction thread ID @@ -319,15 +319,15 @@ public: } Type; // Type of a scope, currently module is only interesting private: // Fastpath: - VerilatedSyms* m_symsp; ///< Symbol table - void** m_callbacksp; ///< Callback table pointer (Fastpath) - int m_funcnumMax; ///< Maxium function number stored (Fastpath) + VerilatedSyms* m_symsp = nullptr; ///< Symbol table + void** m_callbacksp = nullptr; ///< Callback table pointer (Fastpath) + int m_funcnumMax = 0; ///< Maxium function number stored (Fastpath) // 4 bytes padding (on -m64), for rent. - VerilatedVarNameMap* m_varsp; ///< Variable map - const char* m_namep; ///< Scope name (Slowpath) - const char* m_identifierp; ///< Identifier of scope (with escapes removed) - vlsint8_t m_timeunit; ///< Timeunit in negative power-of-10 - Type m_type; ///< Type of the scope + VerilatedVarNameMap* m_varsp = nullptr; ///< Variable map + const char* m_namep = nullptr; ///< Scope name (Slowpath) + const char* m_identifierp = nullptr; ///< Identifier of scope (with escapes removed) + vlsint8_t m_timeunit = 0; ///< Timeunit in negative power-of-10 + Type m_type = SCOPE_OTHER; ///< Type of the scope public: // But internals only - called from VerilatedModule's VerilatedScope(); @@ -393,8 +393,8 @@ class Verilated { static struct NonSerialized { // Non-serialized information // These are reloaded from on command-line settings, so do not need to persist // Fast path - vluint64_t s_profThreadsStart; ///< +prof+threads starting time - vluint32_t s_profThreadsWindow; ///< +prof+threads window size + vluint64_t s_profThreadsStart = 1; ///< +prof+threads starting time + vluint32_t s_profThreadsWindow = 2; ///< +prof+threads window size // Slow path const char* s_profThreadsFilenamep; ///< +prof+threads filename NonSerialized(); @@ -405,23 +405,22 @@ class Verilated { // assumption is that the restore is allowed to pass different arguments static struct CommandArgValues { VerilatedMutex m_argMutex; ///< Mutex for s_args members, when VL_THREADED - int argc; - const char** argv; - CommandArgValues() - : argc(0) - , argv(nullptr) {} + int argc = 0; + const char** argv = nullptr; + CommandArgValues() {} ~CommandArgValues() {} } s_args; // Not covered by mutex, as per-thread static VL_THREAD_LOCAL struct ThreadLocal { #ifdef VL_THREADED - vluint32_t t_mtaskId; ///< Current mtask# executing on this thread - vluint32_t t_endOfEvalReqd; ///< Messages may be pending, thread needs endOf-eval calls + vluint32_t t_mtaskId = 0; ///< Current mtask# executing on this thread + vluint32_t t_endOfEvalReqd + = 0; ///< Messages may be pending, thread needs endOf-eval calls #endif - const VerilatedScope* t_dpiScopep; ///< DPI context scope - const char* t_dpiFilename; ///< DPI context filename - int t_dpiLineno; ///< DPI context line number + const VerilatedScope* t_dpiScopep = nullptr; ///< DPI context scope + const char* t_dpiFilename = nullptr; ///< DPI context filename + int t_dpiLineno = 0; ///< DPI context line number ThreadLocal(); ~ThreadLocal(); diff --git a/include/verilated_cov.cpp b/include/verilated_cov.cpp index 366b229c1..ca8b9e688 100644 --- a/include/verilated_cov.cpp +++ b/include/verilated_cov.cpp @@ -75,7 +75,7 @@ public: // CONSTRUCTORS // cppcheck-suppress noExplicitConstructor explicit VerilatedCoverItemSpec(T* countp) - : m_countp(countp) { + : m_countp{countp} { *m_countp = 0; } virtual ~VerilatedCoverItemSpec() override {} diff --git a/include/verilated_fst_c.cpp b/include/verilated_fst_c.cpp index b8f6e9f05..b3ce35958 100644 --- a/include/verilated_fst_c.cpp +++ b/include/verilated_fst_c.cpp @@ -58,9 +58,7 @@ // VerilatedFst VerilatedFst::VerilatedFst(void* fst) - : m_fst(fst) - , m_symbolp(nullptr) - , m_strbuf(nullptr) {} + : m_fst{fst} {} VerilatedFst::~VerilatedFst() { if (m_fst) fstWriterClose(m_fst); diff --git a/include/verilated_fst_c.h b/include/verilated_fst_c.h index a86dd3f4d..f4aaf08ec 100644 --- a/include/verilated_fst_c.h +++ b/include/verilated_fst_c.h @@ -50,8 +50,8 @@ private: Code2SymbolType m_code2symbol; Local2FstDtype m_local2fstdtype; std::list m_curScope; - fstHandle* m_symbolp; ///< same as m_code2symbol, but as an array - char* m_strbuf; ///< String buffer long enough to hold maxBits() chars + fstHandle* m_symbolp = nullptr; ///< same as m_code2symbol, but as an array + char* m_strbuf = nullptr; ///< String buffer long enough to hold maxBits() chars // CONSTRUCTORS VL_UNCOPYABLE(VerilatedFst); @@ -136,7 +136,7 @@ class VerilatedFstC { public: explicit VerilatedFstC(void* filep = nullptr) - : m_sptrace(filep) {} + : m_sptrace{filep} {} ~VerilatedFstC() { close(); } /// Routines can only be called from one thread; allow next call from different thread void changeThread() { spTrace()->changeThread(); } diff --git a/include/verilated_imp.h b/include/verilated_imp.h index 3ae2c1f5c..905b42e3a 100644 --- a/include/verilated_imp.h +++ b/include/verilated_imp.h @@ -62,8 +62,8 @@ private: public: // CONSTRUCTORS VerilatedMsg(const std::function& cb) - : m_mtaskId(Verilated::mtaskId()) - , m_cb(cb) {} + : m_mtaskId{Verilated::mtaskId()} + , m_cb{cb} {} ~VerilatedMsg() {} // METHODS vluint32_t mtaskId() const { return m_mtaskId; } @@ -84,7 +84,7 @@ class VerilatedEvalMsgQueue { public: // CONSTRUCTORS VerilatedEvalMsgQueue() - : m_depth(0) { + : m_depth{0} { assert(atomic_is_lock_free(&m_depth)); } ~VerilatedEvalMsgQueue() {} @@ -172,12 +172,11 @@ public: // FILE* list constructed from a file-descriptor class VerilatedFpList { FILE* m_fp[31]; - std::size_t m_sz; + std::size_t m_sz = 0; public: typedef FILE* const* const_iterator; - explicit VerilatedFpList() - : m_sz(0) {} + explicit VerilatedFpList() {} const_iterator begin() const { return m_fp; } const_iterator end() const { return m_fp + m_sz; } std::size_t size() const { return m_sz; } @@ -204,14 +203,11 @@ protected: static VerilatedImp s_s; ///< Static Singleton; One and only static this struct Serialized { // All these members serialized/deserialized - int m_timeFormatUnits; // $timeformat units - int m_timeFormatPrecision; // $timeformat number of decimal places - int m_timeFormatWidth; // $timeformat character width + int m_timeFormatUnits = UNITS_NONE; // $timeformat units + int m_timeFormatPrecision = 0; // $timeformat number of decimal places + int m_timeFormatWidth = 20; // $timeformat character width enum { UNITS_NONE = 99 }; // Default based on precision - Serialized() - : m_timeFormatUnits(UNITS_NONE) - , m_timeFormatPrecision(0) - , m_timeFormatWidth(20) {} + Serialized() {} ~Serialized() {} } m_ser; @@ -255,8 +251,8 @@ protected: public: // But only for verilated*.cpp // CONSTRUCTORS VerilatedImp() - : m_argVecLoaded(false) - , m_exportNext(0) { + : m_argVecLoaded{false} + , m_exportNext{0} { s_s.m_fdps.resize(31); std::fill(s_s.m_fdps.begin(), s_s.m_fdps.end(), (FILE*)0); s_s.m_fdFreeMct.resize(30); diff --git a/include/verilated_sym_props.h b/include/verilated_sym_props.h index 499f962b4..9d5b9fb4a 100644 --- a/include/verilated_sym_props.h +++ b/include/verilated_sym_props.h @@ -44,11 +44,11 @@ protected: friend class VerilatedVarProps; friend class VerilatedScope; VerilatedRange() - : m_left(0) - , m_right(0) {} + : m_left{0} + , m_right{0} {} VerilatedRange(int left, int right) - : m_left(left) - , m_right(right) {} + : m_left{left} + , m_right{right} {} void init(int left, int right) { m_left = left; m_right = right; @@ -92,11 +92,11 @@ class VerilatedVarProps { protected: friend class VerilatedScope; VerilatedVarProps(VerilatedVarType vltype, VerilatedVarFlags vlflags, int pdims, int udims) - : m_magic(MAGIC) - , m_vltype(vltype) - , m_vlflags(vlflags) - , m_pdims(pdims) - , m_udims(udims) { + : m_magic{MAGIC} + , m_vltype{vltype} + , m_vlflags{vlflags} + , m_pdims{pdims} + , m_udims{udims} { initUnpacked(nullptr); } @@ -104,36 +104,36 @@ public: class Unpacked {}; // Without packed VerilatedVarProps(VerilatedVarType vltype, int vlflags) - : m_magic(MAGIC) - , m_vltype(vltype) - , m_vlflags(VerilatedVarFlags(vlflags)) - , m_pdims(0) - , m_udims(0) {} + : m_magic{MAGIC} + , m_vltype{vltype} + , m_vlflags{VerilatedVarFlags(vlflags)} + , m_pdims{0} + , m_udims{0} {} VerilatedVarProps(VerilatedVarType vltype, int vlflags, Unpacked, int udims, const int* ulims) - : m_magic(MAGIC) - , m_vltype(vltype) - , m_vlflags(VerilatedVarFlags(vlflags)) - , m_pdims(0) - , m_udims(udims) { + : m_magic{MAGIC} + , m_vltype{vltype} + , m_vlflags{VerilatedVarFlags(vlflags)} + , m_pdims{0} + , m_udims{udims} { initUnpacked(ulims); } // With packed class Packed {}; VerilatedVarProps(VerilatedVarType vltype, int vlflags, Packed, int pl, int pr) - : m_magic(MAGIC) - , m_vltype(vltype) - , m_vlflags(VerilatedVarFlags(vlflags)) - , m_pdims(1) - , m_udims(0) - , m_packed(pl, pr) {} + : m_magic{MAGIC} + , m_vltype{vltype} + , m_vlflags{VerilatedVarFlags(vlflags)} + , m_pdims{1} + , m_udims{0} + , m_packed{pl, pr} {} VerilatedVarProps(VerilatedVarType vltype, int vlflags, Packed, int pl, int pr, Unpacked, int udims, const int* ulims) - : m_magic(MAGIC) - , m_vltype(vltype) - , m_vlflags(VerilatedVarFlags(vlflags)) - , m_pdims(1) - , m_udims(udims) - , m_packed(pl, pr) { + : m_magic{MAGIC} + , m_vltype{vltype} + , m_vlflags{VerilatedVarFlags(vlflags)} + , m_pdims{1} + , m_udims{udims} + , m_packed{pl, pr} { initUnpacked(ulims); } @@ -196,11 +196,11 @@ class VerilatedDpiOpenVar { public: // CONSTRUCTORS VerilatedDpiOpenVar(const VerilatedVarProps* propsp, void* datap) - : m_propsp(propsp) - , m_datap(datap) {} + : m_propsp{propsp} + , m_datap{datap} {} VerilatedDpiOpenVar(const VerilatedVarProps* propsp, const void* datap) - : m_propsp(propsp) - , m_datap(const_cast(datap)) {} + : m_propsp{propsp} + , m_datap{const_cast(datap)} {} ~VerilatedDpiOpenVar() {} // METHODS void* datap() const { return m_datap; } @@ -237,10 +237,10 @@ protected: // CONSTRUCTORS VerilatedVar(const char* namep, void* datap, VerilatedVarType vltype, VerilatedVarFlags vlflags, int dims, bool isParam) - : VerilatedVarProps(vltype, vlflags, (dims > 0 ? 1 : 0), ((dims > 1) ? dims - 1 : 0)) - , m_datap(datap) - , m_namep(namep) - , m_isParam(isParam) {} + : VerilatedVarProps{vltype, vlflags, (dims > 0 ? 1 : 0), ((dims > 1) ? dims - 1 : 0)} + , m_datap{datap} + , m_namep{namep} + , m_isParam{isParam} {} public: ~VerilatedVar() {} diff --git a/include/verilated_threads.cpp b/include/verilated_threads.cpp index ca5ca403d..f45ae065d 100644 --- a/include/verilated_threads.cpp +++ b/include/verilated_threads.cpp @@ -27,8 +27,8 @@ VL_THREAD_LOCAL VlThreadPool::ProfileTrace* VlThreadPool::t_profilep = nullptr; // VlMTaskVertex VlMTaskVertex::VlMTaskVertex(vluint32_t upstreamDepCount) - : m_upstreamDepsDone(0) - , m_upstreamDepCount(upstreamDepCount) { + : m_upstreamDepsDone{0} + , m_upstreamDepCount{upstreamDepCount} { assert(atomic_is_lock_free(&m_upstreamDepsDone)); } @@ -36,13 +36,11 @@ VlMTaskVertex::VlMTaskVertex(vluint32_t upstreamDepCount) // VlWorkerThread VlWorkerThread::VlWorkerThread(VlThreadPool* poolp, bool profiling) - : m_waiting(false) - , m_ready_size(0) - , m_poolp(poolp) - , m_profiling(profiling) - , m_exiting(false) - // Must init this last -- after setting up fields that it might read: - , m_cthread(startWorker, this) {} + : m_waiting{false} + , m_poolp{poolp} + , m_profiling{profiling} // Must init this last -- after setting up fields that it might read: + , m_exiting{false} + , m_cthread{startWorker, this} {} VlWorkerThread::~VlWorkerThread() { m_exiting.store(true, std::memory_order_release); @@ -78,7 +76,7 @@ void VlWorkerThread::startWorker(VlWorkerThread* workerp) { workerp->workerLoop( // VlThreadPool VlThreadPool::VlThreadPool(int nThreads, bool profiling) - : m_profiling(profiling) { + : m_profiling{profiling} { // --threads N passes nThreads=N-1, as the "main" threads counts as 1 unsigned cpus = std::thread::hardware_concurrency(); if (cpus < nThreads + 1) { diff --git a/include/verilated_threads.h b/include/verilated_threads.h index fc2d54f06..56ed7499b 100644 --- a/include/verilated_threads.h +++ b/include/verilated_threads.h @@ -119,23 +119,16 @@ class VlProfileRec { protected: friend class VlThreadPool; enum VlProfileE { TYPE_MTASK_RUN, TYPE_BARRIER }; - VlProfileE m_type; // Record type - vluint32_t m_mtaskId; // Mtask we're logging - vluint32_t m_predictTime; // How long scheduler predicted would take - vluint64_t m_startTime; // Tick at start of execution - vluint64_t m_endTime; // Tick at end of execution + VlProfileE m_type = TYPE_BARRIER; // Record type + vluint32_t m_mtaskId = 0; // Mtask we're logging + vluint32_t m_predictTime = 0; // How long scheduler predicted would take + vluint64_t m_startTime = 0; // Tick at start of execution + vluint64_t m_endTime = 0; // Tick at end of execution unsigned m_cpu; // Execution CPU number (at start anyways) public: class Barrier {}; VlProfileRec() {} - explicit VlProfileRec(Barrier) { - m_type = TYPE_BARRIER; - m_mtaskId = 0; - m_predictTime = 0; - m_startTime = 0; - m_endTime = 0; - m_cpu = getcpu(); - } + explicit VlProfileRec(Barrier) { m_cpu = getcpu(); } void startRecord(vluint64_t time, uint32_t mtask, uint32_t predict) { m_type = VlProfileRec::TYPE_MTASK_RUN; m_mtaskId = mtask; @@ -174,13 +167,13 @@ private: VlThrSymTab m_sym; // Symbol table to execute bool m_evenCycle; // Even/odd for flag alternation ExecRec() - : m_fnp(nullptr) - , m_sym(nullptr) - , m_evenCycle(false) {} + : m_fnp{nullptr} + , m_sym{nullptr} + , m_evenCycle{false} {} ExecRec(VlExecFnp fnp, bool evenCycle, VlThrSymTab sym) - : m_fnp(fnp) - , m_sym(sym) - , m_evenCycle(evenCycle) {} + : m_fnp{fnp} + , m_sym{sym} + , m_evenCycle{evenCycle} {} }; // MEMBERS diff --git a/include/verilated_trace.h b/include/verilated_trace.h index ab854d9fd..85c663e09 100644 --- a/include/verilated_trace.h +++ b/include/verilated_trace.h @@ -130,11 +130,11 @@ private: }; void* m_userp; // The user pointer to pass to the callback (the symbol table) CallbackRecord(initCb_t cb, void* userp) - : m_initCb(cb) - , m_userp(userp) {} + : m_initCb{cb} + , m_userp{userp} {} CallbackRecord(dumpCb_t cb, void* userp) - : m_dumpCb(cb) - , m_userp(userp) {} + : m_dumpCb{cb} + , m_userp{userp} {} }; vluint32_t* m_sigs_oldvalp; ///< Old value store diff --git a/include/verilated_trace_imp.cpp b/include/verilated_trace_imp.cpp index 16d39fdd3..5de211590 100644 --- a/include/verilated_trace_imp.cpp +++ b/include/verilated_trace_imp.cpp @@ -276,17 +276,19 @@ template <> void VerilatedTrace::onExit(void* selfp) { template <> VerilatedTrace::VerilatedTrace() - : m_sigs_oldvalp(nullptr) - , m_timeLastDump(0) - , m_fullDump(true) - , m_nextCode(0) - , m_numSignals(0) - , m_maxBits(0) - , m_scopeEscape('.') - , m_timeRes(1e-9) - , m_timeUnit(1e-9) + : m_sigs_oldvalp{nullptr} + , m_timeLastDump{0} + , m_fullDump{true} + , m_nextCode{0} + , m_numSignals{0} + , m_maxBits{0} + , m_scopeEscape{'.'} + , m_timeRes{1e-9} + , m_timeUnit { + 1e-9 +} #ifdef VL_TRACE_THREADED - , m_numTraceBuffers(0) +, m_numTraceBuffers { 0 } #endif { set_time_unit(Verilated::timeunitString()); diff --git a/include/verilated_vcd_c.cpp b/include/verilated_vcd_c.cpp index 9edfda0c3..6ae9b51e2 100644 --- a/include/verilated_vcd_c.cpp +++ b/include/verilated_vcd_c.cpp @@ -88,20 +88,14 @@ ssize_t VerilatedVcdFile::write(const char* bufp, ssize_t len) VL_MT_UNSAFE { //============================================================================= // Opening/Closing -VerilatedVcd::VerilatedVcd(VerilatedVcdFile* filep) - : m_isOpen(false) - , m_rolloverMB(0) - , m_modDepth(0) { +VerilatedVcd::VerilatedVcd(VerilatedVcdFile* filep) { // Not in header to avoid link issue if header is included without this .cpp file m_fileNewed = (filep == nullptr); m_filep = m_fileNewed ? new VerilatedVcdFile : filep; - m_namemapp = nullptr; - m_evcd = false; m_wrChunkSize = 8 * 1024; m_wrBufp = new char[m_wrChunkSize * 8]; m_wrFlushp = m_wrBufp + m_wrChunkSize * 6; m_writep = m_wrBufp; - m_wroteBytes = 0; m_suffixesp = nullptr; } diff --git a/include/verilated_vcd_c.h b/include/verilated_vcd_c.h index ccc9662f4..bf4258854 100644 --- a/include/verilated_vcd_c.h +++ b/include/verilated_vcd_c.h @@ -61,23 +61,23 @@ private: VerilatedVcdFile* m_filep; ///< File we're writing to bool m_fileNewed; ///< m_filep needs destruction - bool m_isOpen; ///< True indicates open file - bool m_evcd; ///< True for evcd format + bool m_isOpen = false; ///< True indicates open file + bool m_evcd = false; ///< True for evcd format std::string m_filename; ///< Filename we're writing to (if open) - vluint64_t m_rolloverMB; ///< MB of file size to rollover at - int m_modDepth; ///< Depth of module hierarchy + vluint64_t m_rolloverMB = 0; ///< MB of file size to rollover at + int m_modDepth = 0; ///< Depth of module hierarchy char* m_wrBufp; ///< Output buffer char* m_wrFlushp; ///< Output buffer flush trigger location char* m_writep; ///< Write pointer into output buffer vluint64_t m_wrChunkSize; ///< Output buffer size - vluint64_t m_wroteBytes; ///< Number of bytes written to this file + vluint64_t m_wroteBytes = 0; ///< Number of bytes written to this file std::vector m_suffixes; ///< VCD line end string codes + metadata const char* m_suffixesp; ///< Pointer to first element of above typedef std::map NameMap; - NameMap* m_namemapp; ///< List of names for the header + NameMap* m_namemapp = nullptr; ///< List of names for the header void bufferResize(vluint64_t minsize); void bufferFlush() VL_MT_UNSAFE_ONE; @@ -337,7 +337,7 @@ class VerilatedVcdC { public: explicit VerilatedVcdC(VerilatedVcdFile* filep = nullptr) - : m_sptrace(filep) {} + : m_sptrace{filep} {} ~VerilatedVcdC() { close(); } /// Routines can only be called from one thread; allow next call from different thread void changeThread() { spTrace()->changeThread(); } diff --git a/include/verilated_vpi.cpp b/include/verilated_vpi.cpp index 6eca5887b..09c1d7fa1 100644 --- a/include/verilated_vpi.cpp +++ b/include/verilated_vpi.cpp @@ -109,8 +109,8 @@ class VerilatedVpioCb : public VerilatedVpio { public: // cppcheck-suppress uninitVar // m_value VerilatedVpioCb(const t_cb_data* cbDatap, QData time) - : m_cbData(*cbDatap) - , m_time(time) { + : m_cbData{*cbDatap} + , m_time{time} { m_value.format = cbDatap->value ? cbDatap->value->format : vpiSuppressVal; m_cbData.value = &m_value; } @@ -130,7 +130,7 @@ class VerilatedVpioConst : public VerilatedVpio { public: explicit VerilatedVpioConst(vlsint32_t num) - : m_num(num) {} + : m_num{num} {} virtual ~VerilatedVpioConst() override {} static inline VerilatedVpioConst* castp(vpiHandle h) { return dynamic_cast(reinterpret_cast(h)); @@ -145,8 +145,8 @@ class VerilatedVpioParam : public VerilatedVpio { public: VerilatedVpioParam(const VerilatedVar* varp, const VerilatedScope* scopep) - : m_varp(varp) - , m_scopep(scopep) {} + : m_varp{varp} + , m_scopep{scopep} {} virtual ~VerilatedVpioParam() override {} @@ -171,7 +171,7 @@ class VerilatedVpioRange : public VerilatedVpio { public: explicit VerilatedVpioRange(const VerilatedRange* range) - : m_range(range) {} + : m_range{range} {} virtual ~VerilatedVpioRange() override {} static inline VerilatedVpioRange* castp(vpiHandle h) { return dynamic_cast(reinterpret_cast(h)); @@ -197,7 +197,7 @@ protected: public: explicit VerilatedVpioScope(const VerilatedScope* scopep) - : m_scopep(scopep) {} + : m_scopep{scopep} {} virtual ~VerilatedVpioScope() override {} static inline VerilatedVpioScope* castp(vpiHandle h) { return dynamic_cast(reinterpret_cast(h)); @@ -227,9 +227,9 @@ protected: public: VerilatedVpioVar(const VerilatedVar* varp, const VerilatedScope* scopep) - : m_varp(varp) - , m_scopep(scopep) - , m_index(0) { + : m_varp{varp} + , m_scopep{scopep} + , m_index{0} { m_prevDatap = nullptr; m_mask.u32 = VL_MASK_I(varp->packed().elements()); m_entSize = varp->entSize(); @@ -272,7 +272,7 @@ class VerilatedVpioMemoryWord : public VerilatedVpioVar { public: VerilatedVpioMemoryWord(const VerilatedVar* varp, const VerilatedScope* scopep, vlsint32_t index, int offset) - : VerilatedVpioVar(varp, scopep) { + : VerilatedVpioVar{varp, scopep} { m_index = index; m_varDatap = (static_cast(varp->datap())) + entSize() * offset; } @@ -295,12 +295,11 @@ public: class VerilatedVpioVarIter : public VerilatedVpio { const VerilatedScope* m_scopep; VerilatedVarNameMap::const_iterator m_it; - bool m_started; + bool m_started = false; public: explicit VerilatedVpioVarIter(const VerilatedScope* scopep) - : m_scopep(scopep) - , m_started(false) {} + : m_scopep{scopep} {} virtual ~VerilatedVpioVarIter() override {} static inline VerilatedVpioVarIter* castp(vpiHandle h) { return dynamic_cast(reinterpret_cast(h)); @@ -329,15 +328,14 @@ class VerilatedVpioMemoryWordIter : public VerilatedVpio { const VerilatedVar* m_varp; vlsint32_t m_iteration; vlsint32_t m_direction; - bool m_done; + bool m_done = false; public: VerilatedVpioMemoryWordIter(const vpiHandle handle, const VerilatedVar* varp) - : m_handle(handle) - , m_varp(varp) - , m_iteration(varp->unpacked().right()) - , m_direction(VL_LIKELY(varp->unpacked().left() > varp->unpacked().right()) ? 1 : -1) - , m_done(false) {} + : m_handle{handle} + , m_varp{varp} + , m_iteration{varp->unpacked().right()} + , m_direction{VL_LIKELY(varp->unpacked().left() > varp->unpacked().right()) ? 1 : -1} {} virtual ~VerilatedVpioMemoryWordIter() override {} static inline VerilatedVpioMemoryWordIter* castp(vpiHandle h) { return dynamic_cast(reinterpret_cast(h)); @@ -361,7 +359,7 @@ class VerilatedVpioModule : public VerilatedVpioScope { public: explicit VerilatedVpioModule(const VerilatedScope* modulep) - : VerilatedVpioScope(modulep) { + : VerilatedVpioScope{modulep} { m_fullname = m_scopep->name(); if (strncmp(m_fullname, "TOP.", 4) == 0) m_fullname += 4; m_name = m_scopep->identifier(); @@ -380,7 +378,7 @@ class VerilatedVpioModuleIter : public VerilatedVpio { public: explicit VerilatedVpioModuleIter(const std::vector& vec) - : m_vec(&vec) { + : m_vec{&vec} { m_it = m_vec->begin(); } virtual ~VerilatedVpioModuleIter() override {} @@ -529,7 +527,7 @@ class VerilatedVpiError { //// Container for vpi error info t_vpi_error_info m_errorInfo; - bool m_flag; + bool m_flag = false; char m_buff[VL_VPI_LINE_SIZE]; void setError(PLI_BYTE8* message, PLI_BYTE8* code, PLI_BYTE8* file, PLI_INT32 line) { m_errorInfo.message = message; @@ -550,8 +548,7 @@ class VerilatedVpiError { } public: - VerilatedVpiError() - : m_flag(false) { + VerilatedVpiError() { m_buff[0] = '\0'; m_errorInfo.product = const_cast(Verilated::productName()); } diff --git a/src/V3Active.cpp b/src/V3Active.cpp index 01d25be8f..c7a07315d 100644 --- a/src/V3Active.cpp +++ b/src/V3Active.cpp @@ -202,8 +202,8 @@ private: public: // CONSTRUCTORS ActiveDlyVisitor(AstNode* nodep, CheckType check) - : m_check(check) - , m_alwaysp(nodep) { + : m_check{check} + , m_alwaysp{nodep} { iterate(nodep); } virtual ~ActiveDlyVisitor() override {} diff --git a/src/V3Assert.cpp b/src/V3Assert.cpp index 7ad9ea18d..7b1ba595a 100644 --- a/src/V3Assert.cpp +++ b/src/V3Assert.cpp @@ -34,9 +34,9 @@ private: AstUser1InUse m_inuser1; // STATE - AstNodeModule* m_modp; // Last module - AstBegin* m_beginp; // Last begin - unsigned m_modPastNum; // Module past numbering + AstNodeModule* m_modp = nullptr; // Last module + AstBegin* m_beginp = nullptr; // Last begin + unsigned m_modPastNum = 0; // Module past numbering VDouble0 m_statCover; // Statistic tracking VDouble0 m_statAsNotImm; // Statistic tracking VDouble0 m_statAsImm; // Statistic tracking @@ -385,13 +385,7 @@ private: public: // CONSTRUCTORS - explicit AssertVisitor(AstNetlist* nodep) { - m_beginp = nullptr; - m_modp = nullptr; - m_modPastNum = 0; - // Process - iterate(nodep); - } + explicit AssertVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~AssertVisitor() override { V3Stats::addStat("Assertions, assert non-immediate statements", m_statAsNotImm); V3Stats::addStat("Assertions, assert immediate statements", m_statAsImm); diff --git a/src/V3AssertPre.cpp b/src/V3AssertPre.cpp index 83f60c49b..2bc745a1c 100644 --- a/src/V3AssertPre.cpp +++ b/src/V3AssertPre.cpp @@ -34,11 +34,11 @@ private: // NODE STATE/TYPES // STATE // Reset each module: - AstSenItem* m_seniDefaultp; // Default sensitivity (from AstDefClock) + AstSenItem* m_seniDefaultp = nullptr; // Default sensitivity (from AstDefClock) // Reset each assertion: - AstSenItem* m_senip; // Last sensitivity + AstSenItem* m_senip = nullptr; // Last sensitivity // Reset each always: - AstSenItem* m_seniAlwaysp; // Last sensitivity in always + AstSenItem* m_seniAlwaysp = nullptr; // Last sensitivity in always // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -170,8 +170,6 @@ private: public: // CONSTRUCTORS explicit AssertPreVisitor(AstNetlist* nodep) { - m_seniDefaultp = nullptr; - m_seniAlwaysp = nullptr; clearAssertInfo(); // Process iterate(nodep); diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp index d6e3eb0f5..aa00791ae 100644 --- a/src/V3AstNodes.cpp +++ b/src/V3AstNodes.cpp @@ -212,7 +212,7 @@ AstNodeBiop* AstEqWild::newTyped(FileLine* fl, AstNode* lhsp, AstNode* rhsp) { } AstExecGraph::AstExecGraph(FileLine* fileline) - : AstNode(AstType::atExecGraph, fileline) { + : AstNode{AstType::atExecGraph, fileline} { m_depGraphp = new V3Graph; } AstExecGraph::~AstExecGraph() { VL_DO_DANGLING(delete m_depGraphp, m_depGraphp); } diff --git a/src/V3Begin.cpp b/src/V3Begin.cpp index 4d52adb37..288105ffe 100644 --- a/src/V3Begin.cpp +++ b/src/V3Begin.cpp @@ -250,7 +250,7 @@ private: public: // CONSTRUCTORS BeginVisitor(AstNetlist* nodep, BeginState* statep) - : m_statep(statep) { + : m_statep{statep} { iterate(nodep); } virtual ~BeginVisitor() override {} diff --git a/src/V3CUse.cpp b/src/V3CUse.cpp index 9630f3749..0cabf7526 100644 --- a/src/V3CUse.cpp +++ b/src/V3CUse.cpp @@ -67,7 +67,7 @@ public: // CONSTRUCTORS explicit CUseState(AstNodeModule* nodep) - : m_modInsertp(nodep) {} + : m_modInsertp{nodep} {} virtual ~CUseState() {} VL_UNCOPYABLE(CUseState); }; @@ -107,7 +107,7 @@ class CUseDTypeVisitor : public AstNVisitor { public: // CONSTRUCTORS explicit CUseDTypeVisitor(AstNodeModule* nodep, CUseState& stater) - : m_stater(stater) { + : m_stater{stater} { iterate(nodep); } virtual ~CUseDTypeVisitor() override {} @@ -208,7 +208,7 @@ class CUseVisitor : public AstNVisitor { public: // CONSTRUCTORS explicit CUseVisitor(AstNodeModule* nodep) - : m_state(nodep) { + : m_state{nodep} { iterate(nodep); } virtual ~CUseVisitor() override {} diff --git a/src/V3Case.cpp b/src/V3Case.cpp index dd0fe6a03..ac15870f7 100644 --- a/src/V3Case.cpp +++ b/src/V3Case.cpp @@ -52,7 +52,8 @@ class CaseLintVisitor : public AstNVisitor { private: - AstNodeCase* m_caseExprp; // Under a CASE value node, if so the relevant case statement + AstNodeCase* m_caseExprp + = nullptr; // Under a CASE value node, if so the relevant case statement // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -109,10 +110,7 @@ private: public: // CONSTRUCTORS - explicit CaseLintVisitor(AstNodeCase* nodep) { - m_caseExprp = nullptr; - iterate(nodep); - } + explicit CaseLintVisitor(AstNodeCase* nodep) { iterate(nodep); } virtual ~CaseLintVisitor() override {} }; @@ -131,9 +129,9 @@ private: VDouble0 m_statCaseSlow; // Statistic tracking // Per-CASE - int m_caseWidth; // Width of valueItems - int m_caseItems; // Number of caseItem unique values - bool m_caseNoOverlapsAllCovered; // Proven to be synopsys parallel_case compliant + int m_caseWidth = 0; // Width of valueItems + int m_caseItems = 0; // Number of caseItem unique values + bool m_caseNoOverlapsAllCovered = false; // Proven to be synopsys parallel_case compliant // For each possible value, the case branch we need AstNode* m_valueItem[1 << CASE_OVERLAP_WIDTH]; @@ -488,9 +486,6 @@ private: public: // CONSTRUCTORS explicit CaseVisitor(AstNetlist* nodep) { - m_caseWidth = 0; - m_caseItems = 0; - m_caseNoOverlapsAllCovered = false; for (uint32_t i = 0; i < (1UL << CASE_OVERLAP_WIDTH); ++i) m_valueItem[i] = nullptr; iterate(nodep); } diff --git a/src/V3Cdc.cpp b/src/V3Cdc.cpp index e3ba1d4db..cbe2c3840 100644 --- a/src/V3Cdc.cpp +++ b/src/V3Cdc.cpp @@ -60,12 +60,12 @@ class CdcEitherVertex : public V3GraphVertex { public: CdcEitherVertex(V3Graph* graphp, AstScope* scopep, AstNode* nodep) - : V3GraphVertex(graphp) - , m_scopep(scopep) - , m_nodep(nodep) - , m_srcDomainSet(false) - , m_dstDomainSet(false) - , m_asyncPath(false) {} + : V3GraphVertex{graphp} + , m_scopep{scopep} + , m_nodep{nodep} + , m_srcDomainSet{false} + , m_dstDomainSet{false} + , m_asyncPath{false} {} virtual ~CdcEitherVertex() override {} // ACCESSORS virtual FileLine* fileline() const override { return nodep()->fileline(); } @@ -90,8 +90,8 @@ class CdcVarVertex : public CdcEitherVertex { public: CdcVarVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) - : CdcEitherVertex(graphp, scopep, varScp) - , m_varScp(varScp) {} + : CdcEitherVertex{graphp, scopep, varScp} + , m_varScp{varScp} {} virtual ~CdcVarVertex() override {} // ACCESSORS AstVarScope* varScp() const { return m_varScp; } @@ -111,9 +111,9 @@ class CdcLogicVertex : public CdcEitherVertex { public: CdcLogicVertex(V3Graph* graphp, AstScope* scopep, AstNode* nodep, AstSenTree* sensenodep) - : CdcEitherVertex(graphp, scopep, nodep) - , m_hazard(false) - , m_isFlop(false) { + : CdcEitherVertex{graphp, scopep, nodep} + , m_hazard{false} + , m_isFlop{false} { srcDomainp(sensenodep); dstDomainp(sensenodep); } @@ -166,8 +166,8 @@ private: public: // CONSTRUCTORS CdcDumpVisitor(AstNode* nodep, std::ofstream* ofp, const string& prefix) - : m_ofp(ofp) - , m_prefix(prefix) { + : m_ofp{ofp} + , m_prefix{prefix} { iterate(nodep); } virtual ~CdcDumpVisitor() override {} @@ -177,8 +177,8 @@ public: class CdcWidthVisitor : public CdcBaseVisitor { private: - int m_maxLineno; - size_t m_maxFilenameLen; + int m_maxLineno = 0; + size_t m_maxFilenameLen = 0; virtual void visit(AstNode* nodep) override { iterateChildren(nodep); @@ -193,11 +193,7 @@ private: public: // CONSTRUCTORS - explicit CdcWidthVisitor(AstNode* nodep) { - m_maxLineno = 0; - m_maxFilenameLen = 0; - iterate(nodep); - } + explicit CdcWidthVisitor(AstNode* nodep) { iterate(nodep); } virtual ~CdcWidthVisitor() override {} // ACCESSORS int maxWidth() { @@ -227,16 +223,16 @@ private: // STATE V3Graph m_graph; // Scoreboard of var usages/dependencies - CdcLogicVertex* m_logicVertexp; // Current statement being tracked, nullptr=ignored - AstScope* m_scopep; // Current scope being processed - AstNodeModule* m_modp; // Current module - AstSenTree* m_domainp; // Current sentree - bool m_inDly; // In delayed assign - int m_inSenItem; // Number of senitems + CdcLogicVertex* m_logicVertexp = nullptr; // Current statement being tracked, nullptr=ignored + AstScope* m_scopep = nullptr; // Current scope being processed + AstNodeModule* m_modp = nullptr; // Current module + AstSenTree* m_domainp = nullptr; // Current sentree + bool m_inDly = false; // In delayed assign + int m_inSenItem = 0; // Number of senitems string m_ofFilename; // Output filename std::ofstream* m_ofp; // Output file - uint32_t m_userGeneration; // Generation count to avoid slow userClearVertices - int m_filelineWidth; // Characters in longest fileline + uint32_t m_userGeneration = 0; // Generation count to avoid slow userClearVertices + int m_filelineWidth = 0; // Characters in longest fileline // METHODS void iterateNewStmt(AstNode* nodep) { @@ -735,15 +731,6 @@ private: public: // CONSTRUCTORS explicit CdcVisitor(AstNode* nodep) { - m_logicVertexp = nullptr; - m_scopep = nullptr; - m_modp = nullptr; - m_domainp = nullptr; - m_inDly = false; - m_inSenItem = 0; - m_userGeneration = 0; - m_filelineWidth = 0; - // Make report of all signal names and what clock edges they have string filename = v3Global.opt.makeDir() + "/" + v3Global.opt.prefix() + "__cdc.txt"; m_ofp = V3File::new_ofstream(filename); diff --git a/src/V3Changed.cpp b/src/V3Changed.cpp index 31d2adb7e..e113ddf0a 100644 --- a/src/V3Changed.cpp +++ b/src/V3Changed.cpp @@ -278,7 +278,7 @@ private: public: // CONSTRUCTORS ChangedVisitor(AstNetlist* nodep, ChangedState* statep) - : m_statep(statep) { + : m_statep{statep} { iterate(nodep); } virtual ~ChangedVisitor() override {} diff --git a/src/V3Clean.cpp b/src/V3Clean.cpp index 4981e38cd..d04fca2c8 100644 --- a/src/V3Clean.cpp +++ b/src/V3Clean.cpp @@ -50,7 +50,7 @@ private: enum CleanState { CS_UNKNOWN, CS_CLEAN, CS_DIRTY }; // STATE - AstNodeModule* m_modp; + AstNodeModule* m_modp = nullptr; // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -300,10 +300,7 @@ private: public: // CONSTRUCTORS - explicit CleanVisitor(AstNetlist* nodep) { - m_modp = nullptr; - iterate(nodep); - } + explicit CleanVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~CleanVisitor() override {} }; diff --git a/src/V3Clock.cpp b/src/V3Clock.cpp index a00348211..7563ead35 100644 --- a/src/V3Clock.cpp +++ b/src/V3Clock.cpp @@ -48,16 +48,16 @@ private: AstUser1InUse m_inuser1; // STATE - AstNodeModule* m_modp; // Current module - AstTopScope* m_topScopep; // Current top scope - AstScope* m_scopep; // Current scope - AstCFunc* m_evalFuncp; // Top eval function we are creating - AstCFunc* m_initFuncp; // Top initial function we are creating - AstCFunc* m_finalFuncp; // Top final function we are creating - AstCFunc* m_settleFuncp; // Top settlement function we are creating - AstSenTree* m_lastSenp; // Last sensitivity match, so we can detect duplicates. - AstIf* m_lastIfp; // Last sensitivity if active to add more under - AstMTaskBody* m_mtaskBodyp; // Current mtask body + AstNodeModule* m_modp = nullptr; // Current module + AstTopScope* m_topScopep = nullptr; // Current top scope + AstScope* m_scopep = nullptr; // Current scope + AstCFunc* m_evalFuncp = nullptr; // Top eval function we are creating + AstCFunc* m_initFuncp = nullptr; // Top initial function we are creating + AstCFunc* m_finalFuncp = nullptr; // Top final function we are creating + AstCFunc* m_settleFuncp = nullptr; // Top settlement function we are creating + AstSenTree* m_lastSenp = nullptr; // Last sensitivity match, so we can detect duplicates. + AstIf* m_lastIfp = nullptr; // Last sensitivity if active to add more under + AstMTaskBody* m_mtaskBodyp = nullptr; // Current mtask body // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -402,17 +402,6 @@ private: public: // CONSTRUCTORS explicit ClockVisitor(AstNetlist* nodep) { - m_modp = nullptr; - m_evalFuncp = nullptr; - m_initFuncp = nullptr; - m_finalFuncp = nullptr; - m_settleFuncp = nullptr; - m_topScopep = nullptr; - m_lastSenp = nullptr; - m_lastIfp = nullptr; - m_scopep = nullptr; - m_mtaskBodyp = nullptr; - // iterate(nodep); // Allow downstream modules to find _eval() // easily without iterating through the tree. diff --git a/src/V3Combine.cpp b/src/V3Combine.cpp index 1deb9ed40..3d4fbc95b 100644 --- a/src/V3Combine.cpp +++ b/src/V3Combine.cpp @@ -173,13 +173,15 @@ private: // STATE typedef enum { STATE_IDLE, STATE_HASH, STATE_DUP } CombineState; VDouble0 m_statCombs; // Statistic tracking - CombineState m_state; // Major state - AstNodeModule* m_modp; // Current module - AstCFunc* m_funcp; // Current function + CombineState m_state = STATE_IDLE; // Major state + AstNodeModule* m_modp = nullptr; // Current module + AstCFunc* m_funcp = nullptr; // Current function CombCallVisitor m_call; // Tracking of function call users - int m_modNFuncs; // Number of functions made - AstNode* m_walkLast1p; // Final node that is the same in duplicate list - AstNode* m_walkLast2p; // Final node that is the same in duplicate list + int m_modNFuncs = 0; // Number of functions made +#ifdef VL_COMBINE_STATEMENTS + AstNode* m_walkLast1p = nullptr; // Final node that is the same in duplicate list +#endif + AstNode* m_walkLast2p = nullptr; // Final node that is the same in duplicate list V3Hashed m_hashed; // Hash for every node in module // METHODS @@ -457,15 +459,7 @@ private: public: // CONSTRUCTORS - explicit CombineVisitor(AstNetlist* nodep) { - m_state = STATE_IDLE; - m_modp = nullptr; - m_funcp = nullptr; - m_modNFuncs = 0; - m_walkLast1p = nullptr; - m_walkLast2p = nullptr; - iterate(nodep); - } + explicit CombineVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~CombineVisitor() override { // V3Stats::addStat("Optimizations, Combined CFuncs", m_statCombs); } diff --git a/src/V3Config.cpp b/src/V3Config.cpp index 4d12d2b06..d205bb7a8 100644 --- a/src/V3Config.cpp +++ b/src/V3Config.cpp @@ -87,8 +87,8 @@ public: AstAttrType m_type; // Type of attribute AstSenTree* m_sentreep; // Sensitivity tree for public_flat_rw V3ConfigVarAttr(AstAttrType type, AstSenTree* sentreep) - : m_type(type) - , m_sentreep(sentreep) {} + : m_type{type} + , m_sentreep{sentreep} {} }; // Overload vector with the required update function and to apply all entries @@ -234,9 +234,9 @@ public: V3ErrorCode m_code; // Error code bool m_on; // True to enable message V3ConfigIgnoresLine(V3ErrorCode code, int lineno, bool on) - : m_lineno(lineno) - , m_code(code) - , m_on(on) {} + : m_lineno{lineno} + , m_code{code} + , m_on{on} {} ~V3ConfigIgnoresLine() {} inline bool operator<(const V3ConfigIgnoresLine& rh) const { if (m_lineno < rh.m_lineno) return true; diff --git a/src/V3Const.cpp b/src/V3Const.cpp index 784528c2b..57c4ef583 100644 --- a/src/V3Const.cpp +++ b/src/V3Const.cpp @@ -59,7 +59,7 @@ class ConstVarFindVisitor : public AstNVisitor { // NODE STATE // AstVar::user4p -> bool, input from ConstVarMarkVisitor // MEMBERS - bool m_found; + bool m_found = false; private: // VISITORS @@ -70,10 +70,7 @@ private: public: // CONSTRUCTORS - explicit ConstVarFindVisitor(AstNode* nodep) { - m_found = false; - iterateAndNextNull(nodep); - } + explicit ConstVarFindVisitor(AstNode* nodep) { iterateAndNextNull(nodep); } virtual ~ConstVarFindVisitor() override {} // METHODS bool found() const { return m_found; } @@ -92,20 +89,20 @@ private: // AstEnum::user4 -> bool. Recursing. // STATE - bool m_params; // If true, propagate parameterized and true numbers only - bool m_required; // If true, must become a constant - bool m_wremove; // Inside scope, no assignw removal - bool m_warn; // Output warnings - bool m_doExpensive; // Enable computationally expensive optimizations - bool m_doNConst; // Enable non-constant-child simplifications - bool m_doShort; // Remove expressions that short circuit - bool m_doV; // Verilog, not C++ conversion - bool m_doGenerate; // Postpone width checking inside generate - bool m_hasJumpDelay; // JumpGo or Delay under this while - AstNodeModule* m_modp; // Current module - AstArraySel* m_selp; // Current select - AstNode* m_scopep; // Current scope - AstAttrOf* m_attrp; // Current attribute + bool m_params = false; // If true, propagate parameterized and true numbers only + bool m_required = false; // If true, must become a constant + bool m_wremove = true; // Inside scope, no assignw removal + bool m_warn = false; // Output warnings + bool m_doExpensive = false; // Enable computationally expensive optimizations + bool m_doNConst = false; // Enable non-constant-child simplifications + bool m_doShort = true; // Remove expressions that short circuit + bool m_doV = false; // Verilog, not C++ conversion + bool m_doGenerate = false; // Postpone width checking inside generate + bool m_hasJumpDelay = false; // JumpGo or Delay under this while + AstNodeModule* m_modp = nullptr; // Current module + AstArraySel* m_selp = nullptr; // Current select + AstNode* m_scopep = nullptr; // Current scope + AstAttrOf* m_attrp = nullptr; // Current attribute // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -2549,21 +2546,6 @@ public: // CONSTRUCTORS explicit ConstVisitor(ProcMode pmode) { - m_params = false; - m_required = false; - m_doExpensive = false; - m_doNConst = false; - m_doShort = true; // Presently always done - m_doV = false; - m_doGenerate = false; // Inside generate conditionals - m_hasJumpDelay = false; - m_warn = false; - m_wremove = true; // Overridden in visitors - m_modp = nullptr; - m_selp = nullptr; - m_scopep = nullptr; - m_attrp = nullptr; - // // clang-format off switch (pmode) { case PROC_PARAMS: m_doV = true; m_doNConst = true; m_params = true; diff --git a/src/V3Coverage.cpp b/src/V3Coverage.cpp index ca40cbe20..b7460d460 100644 --- a/src/V3Coverage.cpp +++ b/src/V3Coverage.cpp @@ -49,9 +49,9 @@ private: AstNode* m_varRefp; // How to get to this element AstNode* m_chgRefp; // How to get to this element ToggleEnt(const string& comment, AstNode* vp, AstNode* cp) - : m_comment(comment) - , m_varRefp(vp) - , m_chgRefp(cp) {} + : m_comment{comment} + , m_varRefp{vp} + , m_chgRefp{cp} {} ~ToggleEnt() {} void cleanup() { VL_DO_CLEAR(m_varRefp->deleteTree(), m_varRefp = nullptr); @@ -70,7 +70,7 @@ private: && v3Global.opt.coverageLine(); } }; - int m_nextHandle; + int m_nextHandle = 0; // NODE STATE // Entire netlist: @@ -79,8 +79,8 @@ private: // STATE CheckState m_state; // State save-restored on each new coverage scope/block - AstNodeModule* m_modp; // Current module to add statement to - bool m_inToggleOff; // In function/task etc + AstNodeModule* m_modp = nullptr; // Current module to add statement to + bool m_inToggleOff = false; // In function/task etc VarNameMap m_varnames; // Uniquification of inserted variable names string m_beginHier; // AstBegin hier name for user coverage points HandleLines m_handleLines; // All line numbers for a given m_stateHandle @@ -539,14 +539,7 @@ private: public: // CONSTRUCTORS - explicit CoverageVisitor(AstNetlist* rootp) { - // Operate on all modules - m_nextHandle = 0; - m_modp = nullptr; - m_beginHier = ""; - m_inToggleOff = false; - iterateChildren(rootp); - } + explicit CoverageVisitor(AstNetlist* rootp) { iterateChildren(rootp); } virtual ~CoverageVisitor() override {} }; diff --git a/src/V3Delayed.cpp b/src/V3Delayed.cpp index af0548f99..1a4d17a64 100644 --- a/src/V3Delayed.cpp +++ b/src/V3Delayed.cpp @@ -89,12 +89,12 @@ private: enum VarUsage { VU_NONE = 0, VU_DLY = 1, VU_NONDLY = 2 }; // STATE - AstActive* m_activep; // Current activate - AstCFunc* m_cfuncp; // Current public C Function - AstAssignDly* m_nextDlyp; // Next delayed assignment in a list of assignments - bool m_inDly; // True in delayed assignments - bool m_inLoop; // True in for loops - bool m_inInitial; // True in initial blocks + AstActive* m_activep = nullptr; // Current activate + AstCFunc* m_cfuncp = nullptr; // Current public C Function + AstAssignDly* m_nextDlyp = nullptr; // Next delayed assignment in a list of assignments + bool m_inDly = false; // True in delayed assignments + bool m_inLoop = false; // True in for loops + bool m_inInitial = false; // True in initial blocks typedef std::map, AstVar*> VarMap; VarMap m_modVarMap; // Table of new var names created under module VDouble0 m_statSharedSet; // Statistic tracking @@ -476,16 +476,7 @@ private: public: // CONSTRUCTORS - explicit DelayedVisitor(AstNetlist* nodep) { - m_inDly = false; - m_activep = nullptr; - m_cfuncp = nullptr; - m_nextDlyp = nullptr; - m_inLoop = false; - m_inInitial = false; - - iterate(nodep); - } + explicit DelayedVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~DelayedVisitor() override { V3Stats::addStat("Optimizations, Delayed shared-sets", m_statSharedSet); } diff --git a/src/V3Depth.cpp b/src/V3Depth.cpp index 1a64eb76b..8ddb9ebb2 100644 --- a/src/V3Depth.cpp +++ b/src/V3Depth.cpp @@ -39,11 +39,11 @@ private: // NODE STATE // STATE - AstNodeModule* m_modp; // Current module - AstCFunc* m_funcp; // Current block - AstNode* m_stmtp; // Current statement - int m_depth; // How deep in an expression - int m_maxdepth; // Maximum depth in an expression + AstNodeModule* m_modp = nullptr; // Current module + AstCFunc* m_funcp = nullptr; // Current block + AstNode* m_stmtp = nullptr; // Current statement + int m_depth = 0; // How deep in an expression + int m_maxdepth = 0; // Maximum depth in an expression // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -151,15 +151,7 @@ private: public: // CONSTRUCTORS - explicit DepthVisitor(AstNetlist* nodep) { - m_modp = nullptr; - m_funcp = nullptr; - m_stmtp = nullptr; - m_depth = 0; - m_maxdepth = 0; - // - iterate(nodep); - } + explicit DepthVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~DepthVisitor() override {} }; diff --git a/src/V3DepthBlock.cpp b/src/V3DepthBlock.cpp index db9b7332d..6092060c6 100644 --- a/src/V3DepthBlock.cpp +++ b/src/V3DepthBlock.cpp @@ -37,10 +37,10 @@ private: // NODE STATE // STATE - AstNodeModule* m_modp; // Current module - AstCFunc* m_funcp; // Current function - int m_depth; // How deep in an expression - int m_deepNum; // How many functions made + AstNodeModule* m_modp = nullptr; // Current module + AstCFunc* m_funcp = nullptr; // Current function + int m_depth = 0; // How deep in an expression + int m_deepNum = 0; // How many functions made // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -119,14 +119,7 @@ private: public: // CONSTRUCTORS - explicit DepthBlockVisitor(AstNetlist* nodep) { - m_modp = nullptr; - m_funcp = nullptr; - m_depth = 0; - m_deepNum = 0; - // - iterate(nodep); - } + explicit DepthBlockVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~DepthBlockVisitor() override {} }; diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index a793aaa43..3f0ffd8c9 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -1253,8 +1253,8 @@ private: public: // CONSTRUCTORS explicit EmitVarTspSorter(const MTaskIdSet& mtaskIds) - : m_mtaskIds(mtaskIds) - , m_serial(++m_serialNext) {} + : m_mtaskIds{mtaskIds} + , m_serial{++m_serialNext} {} virtual ~EmitVarTspSorter() {} // METHODS virtual bool operator<(const TspStateBase& other) const override { @@ -3330,10 +3330,10 @@ class EmitCTrace : EmitCStmts { AstUser1InUse m_inuser1; // MEMBERS - AstCFunc* m_funcp; // Function we're in now + AstCFunc* m_funcp = nullptr; // Function we're in now bool m_slow; // Making slow file - int m_enumNum; // Enumeration number (whole netlist) - int m_baseCode; // Code of first AstTraceInc in this function + int m_enumNum = 0; // Enumeration number (whole netlist) + int m_baseCode = -1; // Code of first AstTraceInc in this function // METHODS void newOutCFile(int filenum) { @@ -3760,11 +3760,8 @@ class EmitCTrace : EmitCStmts { virtual void visit(AstCoverInc* nodep) override {} public: - explicit EmitCTrace(bool slow) { - m_funcp = nullptr; - m_slow = slow; - m_enumNum = 0; - } + explicit EmitCTrace(bool slow) + : m_slow{slow} {} virtual ~EmitCTrace() override {} void main() { // Put out the file diff --git a/src/V3EmitCBase.h b/src/V3EmitCBase.h index 0a51bdac0..75e4838ec 100644 --- a/src/V3EmitCBase.h +++ b/src/V3EmitCBase.h @@ -116,7 +116,7 @@ public: class EmitCBaseCounterVisitor : public AstNVisitor { private: // MEMBERS - int m_count; // Number of statements + int m_count = 0; // Number of statements // VISITORS virtual void visit(AstNode* nodep) override { m_count++; @@ -125,10 +125,7 @@ private: public: // CONSTRUCTORS - explicit EmitCBaseCounterVisitor(AstNode* nodep) { - m_count = 0; - iterate(nodep); - } + explicit EmitCBaseCounterVisitor(AstNode* nodep) { iterate(nodep); } virtual ~EmitCBaseCounterVisitor() override {} int count() const { return m_count; } }; diff --git a/src/V3EmitCSyms.cpp b/src/V3EmitCSyms.cpp index f774f01c9..4878bede3 100644 --- a/src/V3EmitCSyms.cpp +++ b/src/V3EmitCSyms.cpp @@ -43,19 +43,19 @@ class EmitCSyms : EmitCBaseVisitor { string m_type; ScopeData(const string& symName, const string& prettyName, int timeunit, const string& type) - : m_symName(symName) - , m_prettyName(prettyName) - , m_timeunit(timeunit) - , m_type(type) {} + : m_symName{symName} + , m_prettyName{prettyName} + , m_timeunit{timeunit} + , m_type{type} {} }; struct ScopeFuncData { AstScopeName* m_scopep; AstCFunc* m_funcp; AstNodeModule* m_modp; ScopeFuncData(AstScopeName* scopep, AstCFunc* funcp, AstNodeModule* modp) - : m_scopep(scopep) - , m_funcp(funcp) - , m_modp(modp) {} + : m_scopep{scopep} + , m_funcp{funcp} + , m_modp{modp} {} }; struct ScopeVarData { string m_scopeName; @@ -65,11 +65,11 @@ class EmitCSyms : EmitCBaseVisitor { AstScope* m_scopep; ScopeVarData(const string& scopeName, const string& varBasePretty, AstVar* varp, AstNodeModule* modp, AstScope* scopep) - : m_scopeName(scopeName) - , m_varBasePretty(varBasePretty) - , m_varp(varp) - , m_modp(modp) - , m_scopep(scopep) {} + : m_scopeName{scopeName} + , m_varBasePretty{varBasePretty} + , m_varp{varp} + , m_modp{modp} + , m_scopep{scopep} {} }; typedef std::map ScopeFuncs; typedef std::map ScopeVars; @@ -94,8 +94,8 @@ class EmitCSyms : EmitCBaseVisitor { }; // STATE - AstCFunc* m_funcp; // Current function - AstNodeModule* m_modp; // Current module + AstCFunc* m_funcp = nullptr; // Current function + AstNodeModule* m_modp = nullptr; // Current module std::vector m_scopes; // Every scope by module std::vector m_dpis; // DPI functions std::vector m_modVars; // Each public {mod,var} @@ -104,11 +104,11 @@ class EmitCSyms : EmitCBaseVisitor { ScopeVars m_scopeVars; // Each {scope,public-var} ScopeNames m_vpiScopeCandidates; // All scopes for VPI ScopeNameHierarchy m_vpiScopeHierarchy; // The actual hierarchy of scopes - int m_coverBins; // Coverage bin number + int m_coverBins = 0; // Coverage bin number bool m_dpiHdrOnly; // Only emit the DPI header - int m_numStmts; // Number of statements output - int m_funcNum; // CFunc split function number - V3OutCFile* m_ofpBase; // Base (not split) C file + int m_numStmts = 0; // Number of statements output + int m_funcNum = 0; // CFunc split function number + V3OutCFile* m_ofpBase = nullptr; // Base (not split) C file std::map m_usesVfinal; // Split method uses __Vfinal // METHODS @@ -354,13 +354,7 @@ class EmitCSyms : EmitCBaseVisitor { public: explicit EmitCSyms(AstNetlist* nodep, bool dpiHdrOnly) - : m_dpiHdrOnly(dpiHdrOnly) { - m_funcp = nullptr; - m_modp = nullptr; - m_coverBins = 0; - m_numStmts = 0; - m_funcNum = 0; - m_ofpBase = nullptr; + : m_dpiHdrOnly{dpiHdrOnly} { iterate(nodep); } }; diff --git a/src/V3EmitMk.cpp b/src/V3EmitMk.cpp index 3593fca69..27f50be50 100644 --- a/src/V3EmitMk.cpp +++ b/src/V3EmitMk.cpp @@ -400,8 +400,8 @@ class EmitMkHierVerilation { public: explicit EmitMkHierVerilation(const V3HierBlockPlan* planp) - : m_planp(planp) - , m_makefile(v3Global.opt.makeDir() + "/" + v3Global.opt.prefix() + "_hier.mk") { + : m_planp{planp} + , m_makefile{v3Global.opt.makeDir() + "/" + v3Global.opt.prefix() + "_hier.mk"} { V3OutMkFile of(m_makefile); emit(of); } diff --git a/src/V3EmitV.cpp b/src/V3EmitV.cpp index 126a5660f..c2b0f505f 100644 --- a/src/V3EmitV.cpp +++ b/src/V3EmitV.cpp @@ -30,8 +30,8 @@ class EmitVBaseVisitor : public EmitCBaseVisitor { // MEMBERS - bool m_suppressSemi; - AstSenTree* m_sensesp; + bool m_suppressSemi = false; + AstSenTree* m_sensesp; // Domain for printing one a ALWAYS under a ACTIVE // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -658,13 +658,9 @@ class EmitVBaseVisitor : public EmitCBaseVisitor { } public: - bool m_suppressVarSemi; // Suppress emitting semicolon for AstVars - explicit EmitVBaseVisitor(AstSenTree* domainp = nullptr) { - // Domain for printing one a ALWAYS under a ACTIVE - m_suppressSemi = false; - m_suppressVarSemi = false; - m_sensesp = domainp; - } + bool m_suppressVarSemi = false; // Suppress emitting semicolon for AstVars + explicit EmitVBaseVisitor(AstSenTree* domainp = nullptr) + : m_sensesp{domainp} {} virtual ~EmitVBaseVisitor() override {} }; @@ -708,7 +704,7 @@ class EmitVStreamVisitor : public EmitVBaseVisitor { public: EmitVStreamVisitor(AstNode* nodep, std::ostream& os) - : m_os(os) { + : m_os{os} { iterate(nodep); } virtual ~EmitVStreamVisitor() override {} @@ -746,10 +742,10 @@ public: FileLine* prefixFl() const { return m_prefixFl; } int column() const { return m_column; } EmitVPrefixedFormatter(std::ostream& os, const string& prefix, int flWidth) - : V3OutFormatter("__STREAM", V3OutFormatter::LA_VERILOG) - , m_os(os) - , m_prefix(prefix) - , m_flWidth(flWidth) { + : V3OutFormatter{"__STREAM", V3OutFormatter::LA_VERILOG} + , m_os{os} + , m_prefix{prefix} + , m_flWidth{flWidth} { m_column = 0; m_prefixFl = v3Global.rootp() @@ -784,8 +780,8 @@ class EmitVPrefixedVisitor : public EmitVBaseVisitor { public: EmitVPrefixedVisitor(AstNode* nodep, std::ostream& os, const string& prefix, int flWidth, AstSenTree* domainp, bool user3mark) - : EmitVBaseVisitor(domainp) - , m_formatter(os, prefix, flWidth) { + : EmitVBaseVisitor{domainp} + , m_formatter{os, prefix, flWidth} { if (user3mark) { AstUser3InUse::check(); } iterate(nodep); } diff --git a/src/V3EmitXml.cpp b/src/V3EmitXml.cpp index 8399dfcf1..262dde0be 100644 --- a/src/V3EmitXml.cpp +++ b/src/V3EmitXml.cpp @@ -246,7 +246,7 @@ class EmitXmlFileVisitor : public AstNVisitor { public: EmitXmlFileVisitor(AstNode* nodep, V3OutFile* ofp) - : m_ofp(ofp) { + : m_ofp{ofp} { iterate(nodep); } virtual ~EmitXmlFileVisitor() override {} @@ -286,9 +286,9 @@ private: public: // CONSTRUCTORS ModuleFilesXmlVisitor(AstNetlist* nodep, std::ostream& os) - : m_os(os) - , m_modulesCovered() - , m_nodeModules() { + : m_os{os} + , m_modulesCovered{} + , m_nodeModules{} { // Operate on whole netlist nodep->accept(*this); // Xml output @@ -361,7 +361,7 @@ private: public: // CONSTRUCTORS HierCellsXmlVisitor(AstNetlist* nodep, std::ostream& os) - : m_os(os) { + : m_os{os} { // Operate on whole netlist nodep->accept(*this); } diff --git a/src/V3Expand.cpp b/src/V3Expand.cpp index 9bbf7c72f..a1b9d4ed0 100644 --- a/src/V3Expand.cpp +++ b/src/V3Expand.cpp @@ -44,7 +44,7 @@ private: AstUser1InUse m_inuser1; // STATE - AstNode* m_stmtp; // Current statement + AstNode* m_stmtp = nullptr; // Current statement // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -878,10 +878,7 @@ private: public: // CONSTRUCTORS - explicit ExpandVisitor(AstNetlist* nodep) { - m_stmtp = nullptr; - iterate(nodep); - } + explicit ExpandVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~ExpandVisitor() override {} }; diff --git a/src/V3File.cpp b/src/V3File.cpp index 483030212..6b003c6a7 100644 --- a/src/V3File.cpp +++ b/src/V3File.cpp @@ -72,9 +72,9 @@ class V3FileDependImp { struct stat m_stat; // Stat information public: DependFile(const string& filename, bool target) - : m_target(target) - , m_exists(true) - , m_filename(filename) { + : m_target{target} + , m_exists{true} + , m_filename{filename} { m_stat.st_ctime = 0; m_stat.st_mtime = 0; } @@ -338,16 +338,16 @@ class VInFilterImp { typedef VInFilter::StrList StrList; FileContentsMap m_contentsMap; // Cache of file contents - bool m_readEof; // Received EOF on read + bool m_readEof = false; // Received EOF on read #ifdef INFILTER_PIPE - pid_t m_pid; // fork() process id + pid_t m_pid = 0; // fork() process id #else - int m_pid; // fork() process id - always zero as disabled + int m_pid = 0; // fork() process id - always zero as disabled #endif - bool m_pidExited; - int m_pidStatus; - int m_writeFd; // File descriptor TO filter - int m_readFd; // File descriptor FROM filter + bool m_pidExited = false; + int m_pidStatus = 0; + int m_writeFd = 0; // File descriptor TO filter + int m_readFd = 0; // File descriptor FROM filter private: // METHODS @@ -601,15 +601,7 @@ protected: return out; } // CONSTRUCTORS - explicit VInFilterImp(const string& command) { - m_readEof = false; - m_pid = 0; - m_pidExited = false; - m_pidStatus = 0; - m_writeFd = 0; - m_readFd = 0; - start(command); - } + explicit VInFilterImp(const string& command) { start(command); } ~VInFilterImp() { stop(); } }; @@ -631,14 +623,8 @@ bool VInFilter::readWholefile(const string& filename, VInFilter::StrList& outl) // V3OutFormatter: A class for printing to a file, with automatic indentation of C++ code. V3OutFormatter::V3OutFormatter(const string& filename, V3OutFormatter::Language lang) - : m_filename(filename) - , m_lang(lang) - , m_lineno(1) - , m_column(0) - , m_nobreak(false) - , m_prependIndent(true) - , m_indentLevel(0) - , m_bracketLevel(0) { + : m_filename{filename} + , m_lang{lang} { m_blockIndent = v3Global.opt.decoration() ? 4 : 1; m_commaWidth = v3Global.opt.decoration() ? 50 : 150; } @@ -941,7 +927,7 @@ void V3OutFormatter::printf(const char* fmt...) { // V3OutFormatter: A class for printing to a file, with automatic indentation of C++ code. V3OutFile::V3OutFile(const string& filename, V3OutFormatter::Language lang) - : V3OutFormatter(filename, lang) { + : V3OutFormatter{filename, lang} { if ((m_fp = V3File::new_fopen_w(filename)) == nullptr) { v3fatal("Cannot write " << filename); } diff --git a/src/V3File.h b/src/V3File.h index b5faee6aa..652bd56cc 100644 --- a/src/V3File.h +++ b/src/V3File.h @@ -117,13 +117,13 @@ private: Language m_lang; // Indenting Verilog code int m_blockIndent; // Characters per block indent int m_commaWidth; // Width after which to break at ,'s - int m_lineno; - int m_column; - int m_nobreak; // Basic operator or begin paren, don't break next - bool m_prependIndent; - int m_indentLevel; // Current {} indentation + int m_lineno = 1; + int m_column = 0; + int m_nobreak = false; // Basic operator or begin paren, don't break next + bool m_prependIndent = true; + int m_indentLevel = 0; // Current {} indentation std::stack m_parenVec; // Stack of columns where last ( was - int m_bracketLevel; // Intenting = { block, indicates number of {'s seen. + int m_bracketLevel = 0; // Intenting = { block, indicates number of {'s seen. int endLevels(const char* strg); void putcNoTracking(char chr); @@ -195,7 +195,7 @@ class V3OutCFile : public V3OutFile { int m_private; // 1 = Most recently emitted private:, 2 = public: public: explicit V3OutCFile(const string& filename) - : V3OutFile(filename, V3OutFormatter::LA_C) { + : V3OutFile{filename, V3OutFormatter::LA_C} { resetPrivate(); } virtual ~V3OutCFile() override {} @@ -221,7 +221,7 @@ public: class V3OutScFile : public V3OutCFile { public: explicit V3OutScFile(const string& filename) - : V3OutCFile(filename) {} + : V3OutCFile{filename} {} virtual ~V3OutScFile() override {} virtual void putsHeader() override { puts("// Verilated -*- SystemC -*-\n"); } virtual void putsIntTopInclude() override { @@ -234,7 +234,7 @@ public: class V3OutVFile : public V3OutFile { public: explicit V3OutVFile(const string& filename) - : V3OutFile(filename, V3OutFormatter::LA_VERILOG) {} + : V3OutFile{filename, V3OutFormatter::LA_VERILOG} {} virtual ~V3OutVFile() override {} virtual void putsHeader() { puts("// Verilated -*- Verilog -*-\n"); } }; @@ -242,7 +242,7 @@ public: class V3OutXmlFile : public V3OutFile { public: explicit V3OutXmlFile(const string& filename) - : V3OutFile(filename, V3OutFormatter::LA_XML) { + : V3OutFile{filename, V3OutFormatter::LA_XML} { blockIndent(2); } virtual ~V3OutXmlFile() override {} @@ -252,7 +252,7 @@ public: class V3OutMkFile : public V3OutFile { public: explicit V3OutMkFile(const string& filename) - : V3OutFile(filename, V3OutFormatter::LA_MK) {} + : V3OutFile{filename, V3OutFormatter::LA_MK} {} virtual ~V3OutMkFile() override {} virtual void putsHeader() { puts("# Verilated -*- Makefile -*-\n"); } // No automatic indentation yet. diff --git a/src/V3FileLine.cpp b/src/V3FileLine.cpp index ce03e701e..9ba9f91bb 100644 --- a/src/V3FileLine.cpp +++ b/src/V3FileLine.cpp @@ -142,16 +142,16 @@ std::ostream& operator<<(std::ostream& os, VFileContent* contentp) { //###################################################################### // FileLine class functions -FileLine::FileLine(FileLine::EmptySecret) { - // Sort of a singleton - m_firstLineno = 0; - m_lastLineno = 0; - m_firstColumn = 0; - m_lastColumn = 0; +// Sort of a singleton +FileLine::FileLine(FileLine::EmptySecret) + : m_firstLineno{0} + , m_firstColumn{0} + , m_lastLineno{0} + , m_lastColumn{0} + , m_contentLineno{0} + , m_contentp{nullptr} + , m_parent{nullptr} { m_filenameno = singleton().nameToNumber(FileLine::builtInFilename()); - m_contentp = nullptr; - m_contentLineno = 0; - m_parent = nullptr; m_warnOn = 0; for (int codei = V3ErrorCode::EC_MIN; codei < V3ErrorCode::_ENUM_MAX; codei++) { diff --git a/src/V3FileLine.h b/src/V3FileLine.h index a2888c950..e91515d95 100644 --- a/src/V3FileLine.h +++ b/src/V3FileLine.h @@ -126,27 +126,27 @@ private: public: explicit FileLine(const string& filename) - : m_firstLineno(0) - , m_firstColumn(0) - , m_lastLineno(0) - , m_lastColumn(0) - , m_filenameno(singleton().nameToNumber(filename)) - , m_contentLineno(0) - , m_contentp(nullptr) - , m_parent(nullptr) - , m_warnOn(defaultFileLine().m_warnOn) - , m_waive(false) {} + : m_firstLineno{0} + , m_firstColumn{0} + , m_lastLineno{0} + , m_lastColumn{0} + , m_filenameno{singleton().nameToNumber(filename)} + , m_contentLineno{0} + , m_contentp{nullptr} + , m_parent{nullptr} + , m_warnOn{defaultFileLine().m_warnOn} + , m_waive{false} {} explicit FileLine(FileLine* fromp) - : m_firstLineno(fromp->m_firstLineno) - , m_firstColumn(fromp->m_firstColumn) - , m_lastLineno(fromp->m_lastLineno) - , m_lastColumn(fromp->m_lastColumn) - , m_filenameno(fromp->m_filenameno) - , m_contentLineno(fromp->m_contentLineno) - , m_contentp(fromp->m_contentp) - , m_parent(fromp->m_parent) - , m_warnOn(fromp->m_warnOn) - , m_waive(fromp->m_waive) {} + : m_firstLineno{fromp->m_firstLineno} + , m_firstColumn{fromp->m_firstColumn} + , m_lastLineno{fromp->m_lastLineno} + , m_lastColumn{fromp->m_lastColumn} + , m_filenameno{fromp->m_filenameno} + , m_contentLineno{fromp->m_contentLineno} + , m_contentp{fromp->m_contentp} + , m_parent{fromp->m_parent} + , m_warnOn{fromp->m_warnOn} + , m_waive{fromp->m_waive} {} struct EmptySecret {}; // Constructor selection explicit FileLine(EmptySecret); FileLine* copyOrSameFileLine(); diff --git a/src/V3Gate.cpp b/src/V3Gate.cpp index 242f488c1..38c2332c9 100644 --- a/src/V3Gate.cpp +++ b/src/V3Gate.cpp @@ -56,7 +56,7 @@ class GateGraphBaseVisitor { public: V3Graph* m_graphp; // Graph this class is visiting explicit GateGraphBaseVisitor(V3Graph* graphp) - : m_graphp(graphp) {} + : m_graphp{graphp} {} virtual ~GateGraphBaseVisitor() {} virtual VNUser visit(GateLogicVertex* vertexp, VNUser vu = VNUser(0)) = 0; virtual VNUser visit(GateVarVertex* vertexp, VNUser vu = VNUser(0)) = 0; @@ -73,8 +73,8 @@ class GateEitherVertex : public V3GraphVertex { bool m_consumed = false; // Output goes to something meaningful public: GateEitherVertex(V3Graph* graphp, AstScope* scopep) - : V3GraphVertex(graphp) - , m_scopep(scopep) {} + : V3GraphVertex{graphp} + , m_scopep{scopep} {} virtual ~GateEitherVertex() override {} // ACCESSORS virtual string dotStyle() const override { return m_consumed ? "" : "dotted"; } @@ -131,8 +131,8 @@ class GateVarVertex : public GateEitherVertex { AstNode* m_rstAsyncNodep = nullptr; // Used as reset and in SenItem, in clocked always public: GateVarVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) - : GateEitherVertex(graphp, scopep) - , m_varScp(varScp) {} + : GateEitherVertex{graphp, scopep} + , m_varScp{varScp} {} virtual ~GateVarVertex() override {} // ACCESSORS AstVarScope* varScp() const { return m_varScp; } @@ -170,10 +170,10 @@ class GateLogicVertex : public GateEitherVertex { public: GateLogicVertex(V3Graph* graphp, AstScope* scopep, AstNode* nodep, AstActive* activep, bool slow) - : GateEitherVertex(graphp, scopep) - , m_nodep(nodep) - , m_activep(activep) - , m_slow(slow) {} + : GateEitherVertex{graphp, scopep} + , m_nodep{nodep} + , m_activep{activep} + , m_slow{slow} {} virtual ~GateLogicVertex() override {} // ACCESSORS virtual string name() const override { @@ -313,13 +313,13 @@ private: // STATE V3Graph m_graph; // Scoreboard of var usages/dependencies - GateLogicVertex* m_logicVertexp; // Current statement being tracked, nullptr=ignored - AstScope* m_scopep; // Current scope being processed - AstNodeModule* m_modp; // Current module - AstActive* m_activep; // Current active - bool m_activeReducible; // Is activation block reducible? - bool m_inSenItem; // Underneath AstSenItem; any varrefs are clocks - bool m_inSlow; // Inside a slow structure + GateLogicVertex* m_logicVertexp = nullptr; // Current statement being tracked, nullptr=ignored + AstScope* m_scopep = nullptr; // Current scope being processed + AstNodeModule* m_modp = nullptr; // Current module + AstActive* m_activep = nullptr; // Current active + bool m_activeReducible = true; // Is activation block reducible? + bool m_inSenItem = false; // Underneath AstSenItem; any varrefs are clocks + bool m_inSlow = false; // Inside a slow structure VDouble0 m_statSigs; // Statistic tracking VDouble0 m_statRefs; // Statistic tracking VDouble0 m_statDedupLogic; // Statistic tracking @@ -524,13 +524,6 @@ public: // CONSTRUCTORS explicit GateVisitor(AstNode* nodep) { AstNode::user1ClearTree(); - m_logicVertexp = nullptr; - m_scopep = nullptr; - m_modp = nullptr; - m_activep = nullptr; - m_activeReducible = true; - m_inSenItem = false; - m_inSlow = false; iterate(nodep); } virtual ~GateVisitor() override { @@ -1219,7 +1212,7 @@ private: public: explicit GateDedupeGraphVisitor(V3Graph* graphp) - : GateGraphBaseVisitor(graphp) {} + : GateGraphBaseVisitor{graphp} {} void dedupeTree(GateVarVertex* vvertexp) { vvertexp->accept(*this); } VDouble0 numDeduped() { return m_numDeduped; } }; @@ -1254,9 +1247,9 @@ void GateVisitor::dedupe() { class GateMergeAssignsGraphVisitor : public GateGraphBaseVisitor { private: // NODE STATE - AstNodeAssign* m_assignp; - AstActive* m_activep; - GateLogicVertex* m_logicvp; + AstNodeAssign* m_assignp = nullptr; + AstActive* m_activep = nullptr; + GateLogicVertex* m_logicvp = nullptr; VDouble0 m_numMergedAssigns; // Statistic tracking // assemble two Sel into one if possible @@ -1358,12 +1351,8 @@ private: public: explicit GateMergeAssignsGraphVisitor(V3Graph* graphp) - : GateGraphBaseVisitor(graphp) { - m_assignp = nullptr; - m_activep = nullptr; - m_logicvp = nullptr; - m_numMergedAssigns = 0; - m_graphp = graphp; + : GateGraphBaseVisitor{graphp} { + m_graphp = graphp; // In base } void mergeAssignsTree(GateVarVertex* vvertexp) { vvertexp->accept(*this); } VDouble0 numMergedAssigns() { return m_numMergedAssigns; } @@ -1441,8 +1430,8 @@ public: int m_offset; AstVarScope* m_last_vsp; GateClkDecompState(int offset, AstVarScope* vsp) - : m_offset(offset) - , m_last_vsp(vsp) {} + : m_offset{offset} + , m_last_vsp{vsp} {} virtual ~GateClkDecompState() {} }; @@ -1450,12 +1439,12 @@ class GateClkDecompGraphVisitor : public GateGraphBaseVisitor { private: // NODE STATE // AstVarScope::user2p -> bool: already visited - int m_seen_clk_vectors; - AstVarScope* m_clk_vsp; - GateVarVertex* m_clk_vvertexp; + int m_seen_clk_vectors = 0; + AstVarScope* m_clk_vsp = nullptr; + GateVarVertex* m_clk_vvertexp = nullptr; GateConcatVisitor m_concat_visitor; - int m_total_seen_clk_vectors; - int m_total_decomposed_clk_vectors; + int m_total_seen_clk_vectors = 0; + int m_total_decomposed_clk_vectors = 0; virtual VNUser visit(GateVarVertex* vvertexp, VNUser vu) override { // Check that we haven't been here before @@ -1540,13 +1529,7 @@ private: public: explicit GateClkDecompGraphVisitor(V3Graph* graphp) - : GateGraphBaseVisitor(graphp) { - m_seen_clk_vectors = 0; - m_clk_vsp = nullptr; - m_clk_vvertexp = nullptr; - m_total_seen_clk_vectors = 0; - m_total_decomposed_clk_vectors = 0; - } + : GateGraphBaseVisitor{graphp} {} virtual ~GateClkDecompGraphVisitor() override { V3Stats::addStat("Optimizations, Clocker seen vectors", m_total_seen_clk_vectors); V3Stats::addStat("Optimizations, Clocker decomposed vectors", diff --git a/src/V3GenClk.cpp b/src/V3GenClk.cpp index 73a2e426e..60ba799df 100644 --- a/src/V3GenClk.cpp +++ b/src/V3GenClk.cpp @@ -119,7 +119,7 @@ private: public: // CONSTRUCTORS GenClkRenameVisitor(AstTopScope* nodep, AstNodeModule* topModp) - : m_topModp(topModp) { + : m_topModp{topModp} { iterate(nodep); } virtual ~GenClkRenameVisitor() override {} diff --git a/src/V3Global.h b/src/V3Global.h index e3a21aa54..adf794bf2 100644 --- a/src/V3Global.h +++ b/src/V3Global.h @@ -92,9 +92,9 @@ public: // CONSTRUCTORS V3Global() - : m_rootp(nullptr) // created by makeInitNetlist() so static constructors run first - , m_hierPlanp(nullptr) // Set via hierPlanp(V3HierBlockPlan*) when use hier_block - , m_widthMinUsage(VWidthMinUsage::LINT_WIDTH) {} + : m_rootp{nullptr} // created by makeInitNetlist(} so static constructors run first + , m_hierPlanp{nullptr} // Set via hierPlanp(V3HierBlockPlan*} when use hier_block + , m_widthMinUsage{VWidthMinUsage::LINT_WIDTH} {} AstNetlist* makeNetlist(); void boot() { UASSERT(!m_rootp, "call once"); diff --git a/src/V3Graph.cpp b/src/V3Graph.cpp index 1ff942f34..e26121719 100644 --- a/src/V3Graph.cpp +++ b/src/V3Graph.cpp @@ -33,17 +33,17 @@ int V3Graph::debug() { return std::max(V3Error::debugDefault(), s_debug); } // Vertices V3GraphVertex::V3GraphVertex(V3Graph* graphp, const V3GraphVertex& old) - : m_fanout(old.m_fanout) - , m_color(old.m_color) - , m_rank(old.m_rank) { + : m_fanout{old.m_fanout} + , m_color{old.m_color} + , m_rank{old.m_rank} { m_userp = nullptr; verticesPushBack(graphp); } V3GraphVertex::V3GraphVertex(V3Graph* graphp) - : m_fanout(0) - , m_color(0) - , m_rank(0) { + : m_fanout{0} + , m_color{0} + , m_rank{0} { m_userp = nullptr; verticesPushBack(graphp); } diff --git a/src/V3GraphAcyc.cpp b/src/V3GraphAcyc.cpp index 32fa58244..d57a54953 100644 --- a/src/V3GraphAcyc.cpp +++ b/src/V3GraphAcyc.cpp @@ -40,8 +40,8 @@ protected: bool m_deleted = false; // True if deleted public: GraphAcycVertex(V3Graph* graphp, V3GraphVertex* origVertexp) - : V3GraphVertex(graphp) - , m_origVertexp(origVertexp) {} + : V3GraphVertex{graphp} + , m_origVertexp{origVertexp} {} virtual ~GraphAcycVertex() override {} V3GraphVertex* origVertexp() const { return m_origVertexp; } void setDelete() { m_deleted = true; } @@ -66,7 +66,7 @@ private: public: GraphAcycEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, int weight, bool cutable = false) - : V3GraphEdge(graphp, fromp, top, weight, cutable) {} + : V3GraphEdge{graphp, fromp, top, weight, cutable} {} virtual ~GraphAcycEdge() override {} // yellow=we might still cut it, else oldEdge: yellowGreen=made uncutable, red=uncutable virtual string dotColor() const override { @@ -186,8 +186,8 @@ private: public: // CONSTRUCTORS GraphAcyc(V3Graph* origGraphp, V3EdgeFuncP edgeFuncp) - : m_origGraphp(origGraphp) - , m_origEdgeFuncp(edgeFuncp) {} + : m_origGraphp{origGraphp} + , m_origEdgeFuncp{edgeFuncp} {} ~GraphAcyc() { for (std::vector::iterator it = m_origEdgeDelp.begin(); it != m_origEdgeDelp.end(); ++it) { diff --git a/src/V3GraphAlg.cpp b/src/V3GraphAlg.cpp index d721237a3..7ae0b241b 100644 --- a/src/V3GraphAlg.cpp +++ b/src/V3GraphAlg.cpp @@ -119,8 +119,8 @@ private: public: GraphRemoveRedundant(V3Graph* graphp, V3EdgeFuncP edgeFuncp, bool sumWeights) - : GraphAlg<>(graphp, edgeFuncp) - , m_sumWeights(sumWeights) { + : GraphAlg<>{graphp, edgeFuncp} + , m_sumWeights{sumWeights} { main(); } ~GraphRemoveRedundant() {} @@ -284,7 +284,7 @@ private: public: GraphAlgStrongly(V3Graph* graphp, V3EdgeFuncP edgeFuncp) - : GraphAlg<>(graphp, edgeFuncp) { + : GraphAlg<>{graphp, edgeFuncp} { m_currentDfs = 0; main(); } @@ -336,7 +336,7 @@ private: public: GraphAlgRank(V3Graph* graphp, V3EdgeFuncP edgeFuncp) - : GraphAlg<>(graphp, edgeFuncp) { + : GraphAlg<>{graphp, edgeFuncp} { main(); } ~GraphAlgRank() {} @@ -389,7 +389,7 @@ private: public: GraphAlgRLoops(V3Graph* graphp, V3EdgeFuncP edgeFuncp, V3GraphVertex* vertexp) - : GraphAlg<>(graphp, edgeFuncp) { + : GraphAlg<>{graphp, edgeFuncp} { m_done = false; main(vertexp); } @@ -433,8 +433,8 @@ private: public: GraphAlgSubtrees(V3Graph* graphp, V3Graph* loopGraphp, V3EdgeFuncP edgeFuncp, V3GraphVertex* vertexp) - : GraphAlg<>(graphp, edgeFuncp) - , m_loopGraphp(loopGraphp) { + : GraphAlg<>{graphp, edgeFuncp} + , m_loopGraphp{loopGraphp} { // Vertex::m_userp - New vertex if we have seen this vertex already // Edge::m_userp - New edge if we have seen this edge already m_graphp->userClearVertices(); diff --git a/src/V3GraphAlg.h b/src/V3GraphAlg.h index 073c48c98..3d7abaea5 100644 --- a/src/V3GraphAlg.h +++ b/src/V3GraphAlg.h @@ -34,8 +34,8 @@ protected: V3EdgeFuncP m_edgeFuncp; // Function that says we follow this edge // CONSTRUCTORS GraphAlg(T_Graph* graphp, V3EdgeFuncP edgeFuncp) - : m_graphp(graphp) - , m_edgeFuncp(edgeFuncp) {} + : m_graphp{graphp} + , m_edgeFuncp{edgeFuncp} {} ~GraphAlg() {} // METHODS inline bool followEdge(V3GraphEdge* edgep) { diff --git a/src/V3GraphDfa.cpp b/src/V3GraphDfa.cpp index cff104908..9157c283c 100644 --- a/src/V3GraphDfa.cpp +++ b/src/V3GraphDfa.cpp @@ -371,7 +371,7 @@ private: public: GraphNfaToDfa(V3Graph* graphp, V3EdgeFuncP edgeFuncp) - : GraphAlg<>(graphp, edgeFuncp) { + : GraphAlg<>{graphp, edgeFuncp} { m_step = 0; main(); } @@ -500,7 +500,7 @@ private: public: DfaGraphReduce(V3Graph* graphp, V3EdgeFuncP edgeFuncp) - : GraphAlg<>(graphp, edgeFuncp) { + : GraphAlg<>{graphp, edgeFuncp} { if (debug() >= 6) m_graphp->dumpDotFilePrefixed("opt_in"); optimize_accepting_out(); if (debug() >= 6) m_graphp->dumpDotFilePrefixed("opt_acc"); @@ -592,7 +592,7 @@ private: public: DfaGraphComplement(V3Graph* dfagraphp, V3EdgeFuncP edgeFuncp) - : GraphAlg<>(dfagraphp, edgeFuncp) { + : GraphAlg<>{dfagraphp, edgeFuncp} { if (debug() >= 6) m_graphp->dumpDotFilePrefixed("comp_in"); // Vertex::m_user begin: 1 indicates new edge, no more processing diff --git a/src/V3GraphDfa.h b/src/V3GraphDfa.h index 1e757c426..a2ec64bd8 100644 --- a/src/V3GraphDfa.h +++ b/src/V3GraphDfa.h @@ -86,9 +86,9 @@ class DfaVertex : public V3GraphVertex { public: // CONSTRUCTORS explicit DfaVertex(DfaGraph* graphp, bool start = false, bool accepting = false) - : V3GraphVertex(graphp) - , m_start(start) - , m_accepting(accepting) {} + : V3GraphVertex{graphp} + , m_start{start} + , m_accepting{accepting} {} using V3GraphVertex::clone; // We are overriding, not overloading clone(V3Graph*) virtual DfaVertex* clone(DfaGraph* graphp) { return new DfaVertex(graphp, start(), accepting()); @@ -121,13 +121,13 @@ public: static DfaInput NA() { return VNUser::fromInt(1); } // as in not-applicable // CONSTRUCTORS DfaEdge(DfaGraph* graphp, DfaVertex* fromp, DfaVertex* top, const DfaInput& input) - : V3GraphEdge(graphp, fromp, top, 1) + : V3GraphEdge{graphp, fromp, top, 1} , m_input(input) , m_complement(false) {} DfaEdge(DfaGraph* graphp, DfaVertex* fromp, DfaVertex* top, const DfaEdge* copyfrom) - : V3GraphEdge(graphp, fromp, top, copyfrom->weight()) - , m_input(copyfrom->input()) - , m_complement(copyfrom->complement()) {} + : V3GraphEdge{graphp, fromp, top, copyfrom->weight()} + , m_input{copyfrom->input()} + , m_complement{copyfrom->complement()} {} virtual ~DfaEdge() override {} // METHODS virtual string dotColor() const override { diff --git a/src/V3GraphPathChecker.cpp b/src/V3GraphPathChecker.cpp index c9014311e..d0242f9dc 100644 --- a/src/V3GraphPathChecker.cpp +++ b/src/V3GraphPathChecker.cpp @@ -51,8 +51,8 @@ struct GraphPCNode { // GraphPathChecker implementation GraphPathChecker::GraphPathChecker(const V3Graph* graphp, V3EdgeFuncP edgeFuncp) - : GraphAlg(graphp, edgeFuncp) - , m_generation(0) { + : GraphAlg{graphp, edgeFuncp} + , m_generation{0} { for (V3GraphVertex* vxp = graphp->verticesBeginp(); vxp; vxp = vxp->verticesNextp()) { // Setup tracking structure for each node. If delete a vertex // there would be a leak, but ok as accept only const V3Graph*'s. diff --git a/src/V3GraphStream.h b/src/V3GraphStream.h index ba593baa0..1056b965e 100644 --- a/src/V3GraphStream.h +++ b/src/V3GraphStream.h @@ -48,9 +48,9 @@ private: uint32_t m_numBlockingEdges; // Number of blocking edges // CONSTRUCTORS VxHolder(const V3GraphVertex* vxp, uint32_t pos, uint32_t numBlockingEdges) - : m_vxp(vxp) - , m_pos(pos) - , m_numBlockingEdges(numBlockingEdges) {} + : m_vxp{vxp} + , m_pos{pos} + , m_numBlockingEdges{numBlockingEdges} {} // METHODS const V3GraphVertex* vertexp() const { return m_vxp; } // Decrement blocking edges count, return true if the vertex is @@ -68,7 +68,7 @@ private: T_Compare m_lessThan; // Sorting functor // CONSTRUCTORS explicit VxHolderCmp(const T_Compare& lessThan) - : m_lessThan(lessThan) {} + : m_lessThan{lessThan} {} // METHODS bool operator()(const VxHolder& a, const VxHolder& b) const { if (m_lessThan.operator()(a.vertexp(), b.vertexp())) return true; @@ -97,10 +97,10 @@ public: // NOTE: Perhaps REVERSE way should also reverse the sense of the // lessThan function? For now the only usage of REVERSE is not // sensitive to its lessThan at all, so it doesn't matter. - : m_vxHolderCmp(lessThan) - , m_readyVertices(m_vxHolderCmp) - , m_last(m_readyVertices.end()) - , m_way(way) { + : m_vxHolderCmp{lessThan} + , m_readyVertices{m_vxHolderCmp} + , m_last{m_readyVertices.end()} + , m_way{way} { uint32_t pos = 0; for (const V3GraphVertex* vxp = graphp->verticesBeginp(); vxp; vxp = vxp->verticesNextp()) { diff --git a/src/V3GraphTest.cpp b/src/V3GraphTest.cpp index 8765c67a2..ac2f66f48 100644 --- a/src/V3GraphTest.cpp +++ b/src/V3GraphTest.cpp @@ -55,8 +55,8 @@ class V3GraphTestVertex : public V3GraphVertex { public: V3GraphTestVertex(V3Graph* graphp, const string& name) - : V3GraphVertex(graphp) - , m_name(name) {} + : V3GraphVertex{graphp} + , m_name{name} {} virtual ~V3GraphTestVertex() override {} // ACCESSORS virtual string name() const override { return m_name; } @@ -65,7 +65,7 @@ public: class V3GraphTestVarVertex : public V3GraphTestVertex { public: V3GraphTestVarVertex(V3Graph* graphp, const string& name) - : V3GraphTestVertex(graphp, name) {} + : V3GraphTestVertex{graphp, name} {} virtual ~V3GraphTestVarVertex() override {} // ACCESSORS virtual string dotColor() const override { return "blue"; } @@ -265,8 +265,8 @@ class DfaTestVertex : public DfaVertex { public: DfaTestVertex(DfaGraph* graphp, const string& name) - : DfaVertex(graphp) - , m_name(name) {} + : DfaVertex{graphp} + , m_name{name} {} virtual ~DfaTestVertex() override {} // ACCESSORS virtual string name() const override { return m_name; } diff --git a/src/V3Hashed.cpp b/src/V3Hashed.cpp index c473f8873..077a4524b 100644 --- a/src/V3Hashed.cpp +++ b/src/V3Hashed.cpp @@ -94,12 +94,12 @@ private: public: // CONSTRUCTORS explicit HashedVisitor(AstNode* nodep) - : m_cacheInUser4(true) { + : m_cacheInUser4{true} { nodeHashIterate(nodep); // UINFO(9," stmthash "<(nodep)); } V3Hash finalHash() const { return m_lowerHash; } diff --git a/src/V3HierBlock.cpp b/src/V3HierBlock.cpp index f3259f63b..1b3bdf9a4 100644 --- a/src/V3HierBlock.cpp +++ b/src/V3HierBlock.cpp @@ -293,7 +293,7 @@ class HierBlockUsageCollectVisitor : public AstNVisitor { public: HierBlockUsageCollectVisitor(V3HierBlockPlan* planp, AstNetlist* netlist) - : m_planp(planp) { + : m_planp{planp} { iterateChildren(netlist); } VL_DEBUG_FUNC; // Declare debug() diff --git a/src/V3HierBlock.h b/src/V3HierBlock.h index 8bcfada43..6bc0ce285 100644 --- a/src/V3HierBlock.h +++ b/src/V3HierBlock.h @@ -63,8 +63,8 @@ private: public: V3HierBlock(const AstNodeModule* modp, const GParams& gparams) - : m_modp(modp) - , m_gparams(gparams) {} + : m_modp{modp} + , m_gparams{gparams} {} ~V3HierBlock(); VL_DEBUG_FUNC; // Declare debug() diff --git a/src/V3Inline.cpp b/src/V3Inline.cpp index 6ed66a421..00e3dd2bd 100644 --- a/src/V3Inline.cpp +++ b/src/V3Inline.cpp @@ -66,7 +66,7 @@ private: }; // Pragma suggests inlining // STATE - AstNodeModule* m_modp; // Current module + AstNodeModule* m_modp = nullptr; // Current module VDouble0 m_statUnsup; // Statistic tracking typedef std::vector ModVec; @@ -219,10 +219,7 @@ private: public: // CONSTRUCTORS - explicit InlineMarkVisitor(AstNode* nodep) { - m_modp = nullptr; - iterate(nodep); - } + explicit InlineMarkVisitor(AstNode* nodep) { iterate(nodep); } virtual ~InlineMarkVisitor() override { V3Stats::addStat("Optimizations, Inline unsupported", m_statUnsup); // Done with these, are not outputs @@ -471,8 +468,8 @@ private: public: // CONSTRUCTORS InlineRelinkVisitor(AstNodeModule* cloneModp, AstNodeModule* oldModp, AstCell* cellp) - : m_modp(oldModp) - , m_cellp(cellp) { + : m_modp{oldModp} + , m_cellp{cellp} { iterate(cloneModp); } virtual ~InlineRelinkVisitor() override {} @@ -501,7 +498,7 @@ private: AstUser5InUse m_inuser5; // STATE - AstNodeModule* m_modp; // Current module + AstNodeModule* m_modp = nullptr; // Current module VDouble0 m_statCells; // Statistic tracking // METHODS @@ -614,10 +611,7 @@ private: public: // CONSTRUCTORS - explicit InlineVisitor(AstNode* nodep) { - m_modp = nullptr; - iterate(nodep); - } + explicit InlineVisitor(AstNode* nodep) { iterate(nodep); } virtual ~InlineVisitor() override { // V3Stats::addStat("Optimizations, Inlined cells", m_statCells); } diff --git a/src/V3Inst.cpp b/src/V3Inst.cpp index 734233404..6419f98eb 100644 --- a/src/V3Inst.cpp +++ b/src/V3Inst.cpp @@ -42,7 +42,7 @@ private: AstUser1InUse m_inuser1; // STATE - AstCell* m_cellp; // Current cell + AstCell* m_cellp = nullptr; // Current cell // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -131,11 +131,7 @@ private: public: // CONSTRUCTORS - explicit InstVisitor(AstNetlist* nodep) { - m_cellp = nullptr; - // - iterate(nodep); - } + explicit InstVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~InstVisitor() override {} }; @@ -199,8 +195,9 @@ class InstDeVisitor : public AstNVisitor { // Find all cells with arrays, and convert to non-arrayed private: // STATE - AstRange* m_cellRangep; // Range for arrayed instantiations, nullptr for normal instantiations - int m_instSelNum; // Current instantiation count 0..N-1 + AstRange* m_cellRangep + = nullptr; // Range for arrayed instantiations, nullptr for normal instantiations + int m_instSelNum = 0; // Current instantiation count 0..N-1 InstDeModVarVisitor m_deModVars; // State of variables for current cell module VL_DEBUG_FUNC; // Declare debug() @@ -466,12 +463,7 @@ private: public: // CONSTRUCTORS - explicit InstDeVisitor(AstNetlist* nodep) { - m_cellRangep = nullptr; - m_instSelNum = 0; - // - iterate(nodep); - } + explicit InstDeVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~InstDeVisitor() override {} }; diff --git a/src/V3InstrCount.cpp b/src/V3InstrCount.cpp index 6d71f3773..84fc8fac9 100644 --- a/src/V3InstrCount.cpp +++ b/src/V3InstrCount.cpp @@ -56,8 +56,8 @@ private: public: // CONSTRUCTORS VisitBase(InstrCountVisitor* visitor, AstNode* nodep) - : m_nodep(nodep) - , m_visitor(visitor) { + : m_nodep{nodep} + , m_visitor{visitor} { m_savedCount = m_visitor->startVisitBase(nodep); } ~VisitBase() { m_visitor->endVisitBase(m_savedCount, m_nodep); } @@ -69,9 +69,9 @@ private: public: // CONSTRUCTORS InstrCountVisitor(AstNode* nodep, bool assertNoDups, std::ostream* osp) - : m_startNodep(nodep) - , m_assertNoDups(assertNoDups) - , m_osp(osp) { + : m_startNodep{nodep} + , m_assertNoDups{assertNoDups} + , m_osp{osp} { if (nodep) iterate(nodep); } virtual ~InstrCountVisitor() override {} @@ -271,7 +271,7 @@ private: public: // CONSTRUCTORS InstrCountDumpVisitor(AstNode* nodep, std::ostream* osp) - : m_osp(osp) { + : m_osp{osp} { // No check for nullptr output, so... UASSERT_OBJ(osp, nodep, "Don't call if not dumping"); if (nodep) iterate(nodep); diff --git a/src/V3Life.cpp b/src/V3Life.cpp index 00e5e9d08..9c3ee4bc8 100644 --- a/src/V3Life.cpp +++ b/src/V3Life.cpp @@ -484,7 +484,7 @@ private: public: // CONSTRUCTORS LifeTopVisitor(AstNetlist* nodep, LifeState* statep) - : m_statep(statep) { + : m_statep{statep} { iterate(nodep); } virtual ~LifeTopVisitor() override {} diff --git a/src/V3LifePost.cpp b/src/V3LifePost.cpp index f21f28ff6..65ee17693 100644 --- a/src/V3LifePost.cpp +++ b/src/V3LifePost.cpp @@ -104,11 +104,11 @@ struct LifeLocation { public: LifeLocation() - : mtaskp(nullptr) - , sequence(0) {} + : mtaskp{nullptr} + , sequence{0} {} LifeLocation(const ExecMTask* mtaskp_, uint32_t sequence_) - : mtaskp(mtaskp_) - , sequence(sequence_) {} + : mtaskp{mtaskp_} + , sequence{sequence_} {} bool operator<(const LifeLocation& b) const { unsigned a_id = mtaskp ? mtaskp->id() : 0; unsigned b_id = b.mtaskp ? b.mtaskp->id() : 0; @@ -122,10 +122,10 @@ struct LifePostLocation { LifeLocation loc; AstAssignPost* nodep; LifePostLocation() - : nodep(nullptr) {} + : nodep{nullptr} {} LifePostLocation(LifeLocation loc_, AstAssignPost* nodep_) - : loc(loc_) - , nodep(nodep_) {} + : loc{loc_} + , nodep{nodep_} {} }; //###################################################################### diff --git a/src/V3LinkCells.cpp b/src/V3LinkCells.cpp index 1defaeff3..72617a00c 100644 --- a/src/V3LinkCells.cpp +++ b/src/V3LinkCells.cpp @@ -53,8 +53,8 @@ class LinkCellsVertex : public V3GraphVertex { public: LinkCellsVertex(V3Graph* graphp, AstNodeModule* modp) - : V3GraphVertex(graphp) - , m_modp(modp) {} + : V3GraphVertex{graphp} + , m_modp{modp} {} virtual ~LinkCellsVertex() override {} AstNodeModule* modp() const { return m_modp; } virtual string name() const override { return modp()->name(); } @@ -68,7 +68,7 @@ public: class LibraryVertex : public V3GraphVertex { public: explicit LibraryVertex(V3Graph* graphp) - : V3GraphVertex(graphp) {} + : V3GraphVertex{graphp} {} virtual ~LibraryVertex() override {} virtual string name() const override { return "*LIBRARY*"; } }; @@ -109,11 +109,11 @@ private: V3ParseSym* m_parseSymp; // Parser symbol table // Below state needs to be preserved between each module call. - AstNodeModule* m_modp; // Current module + AstNodeModule* m_modp = nullptr; // Current module VSymGraph m_mods; // Symbol table of all module names LinkCellsGraph m_graph; // Linked graph of all cell interconnects - LibraryVertex* m_libVertexp; // Vertex at root of all libraries - V3GraphVertex* m_topVertexp; // Vertex of top module + LibraryVertex* m_libVertexp = nullptr; // Vertex at root of all libraries + V3GraphVertex* m_topVertexp = nullptr; // Vertex of top module std::unordered_set m_declfnWarned; // Files we issued DECLFILENAME on string m_origTopModuleName; // original name of the top module @@ -501,12 +501,9 @@ private: public: // CONSTRUCTORS LinkCellsVisitor(AstNetlist* nodep, VInFilter* filterp, V3ParseSym* parseSymp) - : m_mods(nodep) { + : m_mods{nodep} { m_filterp = filterp; m_parseSymp = parseSymp; - m_modp = nullptr; - m_libVertexp = nullptr; - m_topVertexp = nullptr; if (v3Global.opt.hierChild()) { const V3HierBlockOptSet& hierBlocks = v3Global.opt.hierBlocks(); UASSERT(!v3Global.opt.topModule().empty(), diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index 843e9f2f2..1a67bd700 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -198,7 +198,7 @@ public: // CONSTRUCTORS LinkDotState(AstNetlist* rootp, VLinkDotStep step) - : m_syms(rootp) { + : m_syms{rootp} { UINFO(4, __FUNCTION__ << ": " << endl); m_forPrimary = (step == LDS_PRIMARY); m_forPrearray = (step == LDS_PARAMED || step == LDS_PRIMARY); @@ -1253,7 +1253,7 @@ class LinkDotFindVisitor : public AstNVisitor { public: // CONSTRUCTORS LinkDotFindVisitor(AstNetlist* rootp, LinkDotState* statep) - : m_statep(statep) { + : m_statep{statep} { UINFO(4, __FUNCTION__ << ": " << endl); iterate(rootp); @@ -1419,7 +1419,7 @@ private: public: // CONSTRUCTORS LinkDotParamVisitor(AstNetlist* rootp, LinkDotState* statep) - : m_statep(statep) { + : m_statep{statep} { UINFO(4, __FUNCTION__ << ": " << endl); iterate(rootp); } @@ -1572,7 +1572,7 @@ class LinkDotScopeVisitor : public AstNVisitor { public: // CONSTRUCTORS LinkDotScopeVisitor(AstNetlist* rootp, LinkDotState* statep) - : m_statep(statep) { + : m_statep{statep} { UINFO(4, __FUNCTION__ << ": " << endl); iterate(rootp); } @@ -2799,7 +2799,7 @@ private: public: // CONSTRUCTORS LinkDotResolveVisitor(AstNetlist* rootp, LinkDotState* statep) - : m_statep(statep) { + : m_statep{statep} { UINFO(4, __FUNCTION__ << ": " << endl); iterate(rootp); } diff --git a/src/V3LinkInc.cpp b/src/V3LinkInc.cpp index 5dc4153e4..ff3e33b05 100644 --- a/src/V3LinkInc.cpp +++ b/src/V3LinkInc.cpp @@ -57,10 +57,10 @@ private: }; // STATE - int m_modIncrementsNum; // Var name counter - InsertMode m_insMode; // How to insert - AstNode* m_insStmtp; // Where to insert statement - bool m_unsupportedHere; // Used to detect where it's not supported yet + int m_modIncrementsNum = 0; // Var name counter + InsertMode m_insMode = IM_BEFORE; // How to insert + AstNode* m_insStmtp = nullptr; // Where to insert statement + bool m_unsupportedHere = false; // Used to detect where it's not supported yet private: void insertBeforeStmt(AstNode* nodep, AstNode* newp) { @@ -234,13 +234,7 @@ private: public: // CONSTRUCTORS - explicit LinkIncVisitor(AstNetlist* nodep) { - m_modIncrementsNum = 0; - m_insMode = IM_BEFORE; - m_insStmtp = nullptr; - m_unsupportedHere = false; - iterate(nodep); - } + explicit LinkIncVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~LinkIncVisitor() override {} }; diff --git a/src/V3LinkJump.cpp b/src/V3LinkJump.cpp index 42486f5b5..943b2f2d6 100644 --- a/src/V3LinkJump.cpp +++ b/src/V3LinkJump.cpp @@ -47,12 +47,12 @@ private: typedef std::vector BlockStack; // STATE - AstNodeModule* m_modp; // Current module - AstNodeFTask* m_ftaskp; // Current function/task - AstWhile* m_loopp; // Current loop - bool m_loopInc; // In loop increment - bool m_inFork; // Under fork - int m_modRepeatNum; // Repeat counter + AstNodeModule* m_modp = nullptr; // Current module + AstNodeFTask* m_ftaskp = nullptr; // Current function/task + AstWhile* m_loopp = nullptr; // Current loop + bool m_loopInc = false; // In loop increment + bool m_inFork = false; // Under fork + int m_modRepeatNum = 0; // Repeat counter BlockStack m_blockStack; // All begin blocks above current node // METHODS @@ -285,15 +285,7 @@ private: public: // CONSTRUCTORS - explicit LinkJumpVisitor(AstNetlist* nodep) { - m_modp = nullptr; - m_ftaskp = nullptr; - m_inFork = false; - m_loopp = nullptr; - m_loopInc = false; - m_modRepeatNum = 0; - iterate(nodep); - } + explicit LinkJumpVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~LinkJumpVisitor() override {} }; diff --git a/src/V3LinkLValue.cpp b/src/V3LinkLValue.cpp index 12d71736c..bb6de0176 100644 --- a/src/V3LinkLValue.cpp +++ b/src/V3LinkLValue.cpp @@ -299,7 +299,7 @@ private: public: // CONSTRUCTORS LinkLValueVisitor(AstNode* nodep, bool start) - : m_setRefLvalue(start) { + : m_setRefLvalue{start} { iterate(nodep); } virtual ~LinkLValueVisitor() override {} diff --git a/src/V3LinkParse.cpp b/src/V3LinkParse.cpp index cc9f35680..e303bc78c 100644 --- a/src/V3LinkParse.cpp +++ b/src/V3LinkParse.cpp @@ -48,14 +48,15 @@ private: typedef std::set FileLineSet; // STATE - AstVar* m_varp; // Variable we're under + AstVar* m_varp = nullptr; // Variable we're under ImplTypedefMap m_implTypedef; // Created typedefs for each FileLineSet m_filelines; // Filelines that have been seen - bool m_inAlways; // Inside an always - AstNodeModule* m_valueModp; // If set, move AstVar->valuep() initial values to this module - AstNodeModule* m_modp; // Current module - AstNodeFTask* m_ftaskp; // Current task - AstNodeDType* m_dtypep; // Current data type + bool m_inAlways = false; // Inside an always + AstNodeModule* m_valueModp + = nullptr; // If set, move AstVar->valuep() initial values to this module + AstNodeModule* m_modp = nullptr; // Current module + AstNodeFTask* m_ftaskp = nullptr; // Current task + AstNodeDType* m_dtypep = nullptr; // Current data type // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -595,15 +596,7 @@ private: public: // CONSTRUCTORS - explicit LinkParseVisitor(AstNetlist* rootp) { - m_varp = nullptr; - m_modp = nullptr; - m_ftaskp = nullptr; - m_dtypep = nullptr; - m_inAlways = false; - m_valueModp = nullptr; - iterate(rootp); - } + explicit LinkParseVisitor(AstNetlist* rootp) { iterate(rootp); } virtual ~LinkParseVisitor() override {} }; diff --git a/src/V3LinkResolve.cpp b/src/V3LinkResolve.cpp index 6e5e161d5..f6db3f3f6 100644 --- a/src/V3LinkResolve.cpp +++ b/src/V3LinkResolve.cpp @@ -47,12 +47,12 @@ private: // STATE // Below state needs to be preserved between each module call. - AstNodeModule* m_modp; // Current module - AstClass* m_classp; // Class we're inside - AstNodeFTask* m_ftaskp; // Function or task we're inside - AstNodeCoverOrAssert* m_assertp; // Current assertion - VLifetime m_lifetime; // Propagating lifetime - int m_senitemCvtNum; // Temporary signal counter + AstNodeModule* m_modp = nullptr; // Current module + AstClass* m_classp = nullptr; // Class we're inside + AstNodeFTask* m_ftaskp = nullptr; // Function or task we're inside + AstNodeCoverOrAssert* m_assertp = nullptr; // Current assertion + VLifetime m_lifetime = VLifetime::STATIC; // Propagating lifetime + int m_senitemCvtNum = 0; // Temporary signal counter // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -521,15 +521,7 @@ private: public: // CONSTRUCTORS - explicit LinkResolveVisitor(AstNetlist* rootp) - : m_lifetime(VLifetime::STATIC) { // Static outside a module/class - m_classp = nullptr; - m_ftaskp = nullptr; - m_modp = nullptr; - m_assertp = nullptr; - m_senitemCvtNum = 0; - iterate(rootp); - } + explicit LinkResolveVisitor(AstNetlist* rootp) { iterate(rootp); } virtual ~LinkResolveVisitor() override {} }; @@ -541,7 +533,7 @@ public: class LinkBotupVisitor : public AstNVisitor { private: // STATE - AstNodeModule* m_modp; // Current module + AstNodeModule* m_modp = nullptr; // Current module // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -569,11 +561,7 @@ private: public: // CONSTRUCTORS - explicit LinkBotupVisitor(AstNetlist* rootp) { - m_modp = nullptr; - // - iterate(rootp); - } + explicit LinkBotupVisitor(AstNetlist* rootp) { iterate(rootp); } virtual ~LinkBotupVisitor() override {} }; diff --git a/src/V3Localize.cpp b/src/V3Localize.cpp index 455435cc5..59b36cda8 100644 --- a/src/V3Localize.cpp +++ b/src/V3Localize.cpp @@ -101,7 +101,7 @@ private: // STATE VDouble0 m_statLocVars; // Statistic tracking - AstCFunc* m_cfuncp; // Current active function + AstCFunc* m_cfuncp = nullptr; // Current active function std::vector m_varps; // List of variables to consider for deletion // METHODS @@ -221,10 +221,7 @@ private: public: // CONSTRUCTORS - explicit LocalizeVisitor(AstNetlist* nodep) { - m_cfuncp = nullptr; - iterate(nodep); - } + explicit LocalizeVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~LocalizeVisitor() override { V3Stats::addStat("Optimizations, Vars localized", m_statLocVars); } diff --git a/src/V3MergeCond.cpp b/src/V3MergeCond.cpp index 8fb69e93e..114898b23 100644 --- a/src/V3MergeCond.cpp +++ b/src/V3MergeCond.cpp @@ -126,11 +126,11 @@ private: VDouble0 m_statMergedItems; // Statistic tracking VDouble0 m_statLongestList; // Statistic tracking - AstNode* m_mgFirstp; // First node in merged sequence - AstNode* m_mgCondp; // The condition of the first node - AstNode* m_mgLastp; // Last node in merged sequence - const AstNode* m_mgNextp; // Next node in list being examined - uint32_t m_listLenght; // Length of current list + AstNode* m_mgFirstp = nullptr; // First node in merged sequence + AstNode* m_mgCondp = nullptr; // The condition of the first node + AstNode* m_mgLastp = nullptr; // Last node in merged sequence + const AstNode* m_mgNextp = nullptr; // Next node in list being examined + uint32_t m_listLenght = 0; // Length of current list CheckMergeableVisitor m_checkMergeable; // Sub visitor for encapsulation & speed MarkVarsVisitor m_markVars; // Sub visitor for encapsulation & speed @@ -321,11 +321,6 @@ private: public: // CONSTRUCTORS explicit MergeCondVisitor(AstNetlist* nodep) { - m_mgFirstp = nullptr; - m_mgCondp = nullptr; - m_mgLastp = nullptr; - m_mgNextp = nullptr; - m_listLenght = 0; m_markVars.clear(); iterate(nodep); } diff --git a/src/V3Name.cpp b/src/V3Name.cpp index 6c2800850..ab49d1b9d 100644 --- a/src/V3Name.cpp +++ b/src/V3Name.cpp @@ -40,7 +40,7 @@ private: AstUser1InUse m_inuser1; // STATE - AstNodeModule* m_modp; + AstNodeModule* m_modp = nullptr; // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -136,10 +136,7 @@ private: public: // CONSTRUCTORS - explicit NameVisitor(AstNetlist* nodep) { - m_modp = nullptr; - iterate(nodep); - } + explicit NameVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~NameVisitor() override {} }; diff --git a/src/V3Options.cpp b/src/V3Options.cpp index e00f543e3..ae28b8ff8 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -122,7 +122,7 @@ V3LangCode::V3LangCode(const char* textp) { // VTimescale class functions VTimescale::VTimescale(const string& value, bool& badr) - : m_e(VTimescale::NONE) { + : m_e{VTimescale::NONE} { badr = true; string spaceless = VString::removeWhitespace(value); for (int i = TS_100S; i < _ENUM_END; ++i) { @@ -1786,108 +1786,9 @@ void V3Options::showVersion(bool verbose) { V3Options::V3Options() { m_impp = new V3OptionsImp; - m_assert = false; - m_autoflush = false; - m_bboxSys = false; - m_bboxUnsup = false; - m_build = false; - m_cdc = false; - m_cmake = false; - m_context = true; - m_coverageLine = false; - m_coverageToggle = false; - m_coverageUnderscore = false; - m_coverageUser = false; - m_debugCheck = false; - m_debugCollision = false; - m_debugExitParse = false; - m_debugLeak = true; - m_debugNondeterminism = false; - m_debugPartition = false; - m_debugProtect = false; - m_debugSelfTest = false; - m_decoration = true; - m_dpiHdrOnly = false; - m_dumpDefines = false; - m_exe = false; - m_flatten = false; - m_gmake = false; - m_hierarchical = false; - m_hierChild = false; - m_ignc = false; - m_inhibitSim = false; - m_lintOnly = false; - m_makePhony = false; - m_main = false; - m_orderClockDly = true; - m_outFormatOk = false; - m_pedantic = false; - m_pinsBv = 65; - m_pinsScUint = false; - m_pinsScBigUint = false; - m_pinsUint8 = false; - m_ppComments = false; - m_profCFuncs = false; - m_profThreads = false; - m_protectIds = false; - m_preprocOnly = false; - m_preprocNoLine = false; - m_public = false; - m_publicFlatRW = false; - m_quietExit = false; - m_relativeCFuncs = true; - m_relativeIncludes = false; - m_reportUnoptflat = false; - m_savable = false; - m_stats = false; - m_statsVars = false; - m_structsPacked = true; - m_systemC = false; - m_threads = 0; - m_threadsDpiPure = true; - m_threadsDpiUnpure = false; - m_threadsCoarsen = true; - m_threadsMaxMTasks = 0; - m_trace = false; - m_traceCoverage = false; m_traceFormat = TraceFormat::VCD; - m_traceParams = true; - m_traceStructs = false; - m_traceUnderscore = false; - m_traceThreads = 0; - m_underlineZero = false; - m_verilate = true; - m_vpi = false; - m_xInitialEdge = false; - m_xmlOnly = false; - - m_buildJobs = 1; - m_convergeLimit = 100; - m_dumpTree = 0; - m_dumpTreeAddrids = false; - m_gateStmts = 100; - m_ifDepth = 0; - m_inlineMult = 2000; - m_maxNumWidth = 65536; - m_moduleRecursion = 100; - m_outputSplit = 20000; - m_outputSplitCFuncs = -1; - m_outputSplitCTrace = -1; - m_traceDepth = 0; - m_traceMaxArray = 32; - m_traceMaxWidth = 256; - m_unrollCount = 64; - m_unrollStmts = 30000; - - m_compLimitBlocks = 0; - m_compLimitMembers = 64; - m_compLimitParens = 0; m_makeDir = "obj_dir"; - m_bin = ""; - m_flags = ""; - m_waiverOutput = ""; - m_l2Name = ""; m_unusedRegexp = "*unused*"; m_xAssign = "fast"; diff --git a/src/V3Options.h b/src/V3Options.h index 8b3af3c2a..067e1a2c4 100644 --- a/src/V3Options.h +++ b/src/V3Options.h @@ -248,108 +248,108 @@ private: std::map m_parameters; // Parameters std::map m_hierBlocks; // main switch: --hierarchical-block - bool m_preprocOnly; // main switch: -E - bool m_makePhony; // main switch: -MP - bool m_preprocNoLine;// main switch: -P - bool m_assert; // main switch: --assert - bool m_autoflush; // main switch: --autoflush - bool m_bboxSys; // main switch: --bbox-sys - bool m_bboxUnsup; // main switch: --bbox-unsup - bool m_build; // main switch: --build - bool m_cdc; // main switch: --cdc - bool m_cmake; // main switch: --make cmake - bool m_context; // main switch: --Wcontext - bool m_coverageLine; // main switch: --coverage-block - bool m_coverageToggle;// main switch: --coverage-toggle - bool m_coverageUnderscore;// main switch: --coverage-underscore - bool m_coverageUser; // main switch: --coverage-func - bool m_debugCheck; // main switch: --debug-check - bool m_debugCollision; // main switch: --debug-collision - bool m_debugExitParse; // main switch: --debug-exit-parse - bool m_debugLeak; // main switch: --debug-leak - bool m_debugNondeterminism; // main switch: --debug-nondeterminism - bool m_debugPartition; // main switch: --debug-partition - bool m_debugProtect; // main switch: --debug-protect - bool m_debugSelfTest; // main switch: --debug-self-test - bool m_decoration; // main switch: --decoration - bool m_dpiHdrOnly; // main switch: --dpi-hdr-only - bool m_dumpDefines; // main switch: --dump-defines - bool m_exe; // main switch: --exe - bool m_flatten; // main switch: --flatten - bool m_ignc; // main switch: --ignc - bool m_inhibitSim; // main switch: --inhibit-sim - bool m_lintOnly; // main switch: --lint-only - bool m_gmake; // main switch: --make gmake - bool m_main; // main swithc: --main - bool m_orderClockDly;// main switch: --order-clock-delay - bool m_outFormatOk; // main switch: --cc, --sc or --sp was specified - bool m_pedantic; // main switch: --Wpedantic - bool m_pinsScUint; // main switch: --pins-sc-uint - bool m_pinsScBigUint;// main switch: --pins-sc-biguint - bool m_pinsUint8; // main switch: --pins-uint8 - bool m_ppComments; // main switch: --pp-comments - bool m_profCFuncs; // main switch: --prof-cfuncs - bool m_profThreads; // main switch: --prof-threads - bool m_protectIds; // main switch: --protect-ids - bool m_public; // main switch: --public - bool m_publicFlatRW; // main switch: --public-flat-rw - bool m_quietExit; // main switch: --quiet-exit - bool m_relativeCFuncs; // main switch: --relative-cfuncs - bool m_relativeIncludes; // main switch: --relative-includes - bool m_reportUnoptflat; // main switch: --report-unoptflat - bool m_savable; // main switch: --savable - bool m_structsPacked; // main switch: --structs-packed - bool m_systemC; // main switch: --sc: System C instead of simple C++ - bool m_stats; // main switch: --stats - bool m_statsVars; // main switch: --stats-vars - bool m_threadsCoarsen; // main switch: --threads-coarsen - bool m_threadsDpiPure; // main switch: --threads-dpi all/pure - bool m_threadsDpiUnpure; // main switch: --threads-dpi all - bool m_trace; // main switch: --trace - bool m_traceCoverage; // main switch: --trace-coverage - bool m_traceParams; // main switch: --trace-params - bool m_traceStructs; // main switch: --trace-structs - bool m_traceUnderscore;// main switch: --trace-underscore - bool m_underlineZero;// main switch: --underline-zero; undocumented old Verilator 2 - bool m_verilate; // main swith: --verilate - bool m_vpi; // main switch: --vpi - bool m_xInitialEdge; // main switch: --x-initial-edge - bool m_xmlOnly; // main switch: --xml-only + bool m_preprocOnly = false; // main switch: -E + bool m_makePhony = false; // main switch: -MP + bool m_preprocNoLine = false; // main switch: -P + bool m_assert = false; // main switch: --assert + bool m_autoflush = false; // main switch: --autoflush + bool m_bboxSys = false; // main switch: --bbox-sys + bool m_bboxUnsup = false; // main switch: --bbox-unsup + bool m_build = false; // main switch: --build + bool m_cdc = false; // main switch: --cdc + bool m_cmake = false; // main switch: --make cmake + bool m_context = true; // main switch: --Wcontext + bool m_coverageLine = false; // main switch: --coverage-block + bool m_coverageToggle = false; // main switch: --coverage-toggle + bool m_coverageUnderscore = false; // main switch: --coverage-underscore + bool m_coverageUser = false; // main switch: --coverage-func + bool m_debugCheck = false; // main switch: --debug-check + bool m_debugCollision = false; // main switch: --debug-collision + bool m_debugExitParse = false; // main switch: --debug-exit-parse + bool m_debugLeak = true; // main switch: --debug-leak + bool m_debugNondeterminism = false; // main switch: --debug-nondeterminism + bool m_debugPartition = false; // main switch: --debug-partition + bool m_debugProtect = false; // main switch: --debug-protect + bool m_debugSelfTest = false; // main switch: --debug-self-test + bool m_decoration = true; // main switch: --decoration + bool m_dpiHdrOnly = false; // main switch: --dpi-hdr-only + bool m_dumpDefines = false; // main switch: --dump-defines + bool m_dumpTreeAddrids = false; // main switch: --dump-tree-addrids + bool m_exe = false; // main switch: --exe + bool m_flatten = false; // main switch: --flatten + bool m_hierarchical = false; // main switch: --hierarchical + bool m_hierChild = false; // main switch: --hierarchical-child + bool m_ignc = false; // main switch: --ignc + bool m_inhibitSim = false; // main switch: --inhibit-sim + bool m_lintOnly = false; // main switch: --lint-only + bool m_gmake = false; // main switch: --make gmake + bool m_main = false; // main swithc: --main + bool m_orderClockDly = true; // main switch: --order-clock-delay + bool m_outFormatOk = false; // main switch: --cc, --sc or --sp was specified + bool m_pedantic = false; // main switch: --Wpedantic + bool m_pinsScUint = false; // main switch: --pins-sc-uint + bool m_pinsScBigUint = false; // main switch: --pins-sc-biguint + bool m_pinsUint8 = false; // main switch: --pins-uint8 + bool m_ppComments = false; // main switch: --pp-comments + bool m_profCFuncs = false; // main switch: --prof-cfuncs + bool m_profThreads = false; // main switch: --prof-threads + bool m_protectIds = false; // main switch: --protect-ids + bool m_public = false; // main switch: --public + bool m_publicFlatRW = false; // main switch: --public-flat-rw + bool m_quietExit = false; // main switch: --quiet-exit + bool m_relativeCFuncs = true; // main switch: --relative-cfuncs + bool m_relativeIncludes = false; // main switch: --relative-includes + bool m_reportUnoptflat = false; // main switch: --report-unoptflat + bool m_savable = false; // main switch: --savable + bool m_structsPacked = true; // main switch: --structs-packed + bool m_systemC = false; // main switch: --sc: System C instead of simple C++ + bool m_stats = false; // main switch: --stats + bool m_statsVars = false; // main switch: --stats-vars + bool m_threadsCoarsen = true; // main switch: --threads-coarsen + bool m_threadsDpiPure = true; // main switch: --threads-dpi all/pure + bool m_threadsDpiUnpure = false; // main switch: --threads-dpi all + bool m_trace = false; // main switch: --trace + bool m_traceCoverage = false; // main switch: --trace-coverage + bool m_traceParams = true; // main switch: --trace-params + bool m_traceStructs = false; // main switch: --trace-structs + bool m_traceUnderscore = false; // main switch: --trace-underscore + bool m_underlineZero = false; // main switch: --underline-zero; undocumented old Verilator 2 + bool m_verilate = true; // main swith: --verilate + bool m_vpi = false; // main switch: --vpi + bool m_xInitialEdge = false; // main switch: --x-initial-edge + bool m_xmlOnly = false; // main switch: --xml-only - int m_buildJobs; // main switch: -j - int m_convergeLimit;// main switch: --converge-limit - int m_dumpTree; // main switch: --dump-tree - bool m_dumpTreeAddrids;// main switch: --dump-tree-addrids - int m_gateStmts; // main switch: --gate-stmts - bool m_hierarchical; // main switch: --hierarchical - bool m_hierChild; // main switch: --hierarchical-child - int m_ifDepth; // main switch: --if-depth - int m_inlineMult; // main switch: --inline-mult + int m_buildJobs = 1; // main switch: -j + int m_convergeLimit = 100; // main switch: --converge-limit + int m_dumpTree = 0; // main switch: --dump-tree + int m_gateStmts = 100; // main switch: --gate-stmts + int m_ifDepth = 0; // main switch: --if-depth + int m_inlineMult = 2000; // main switch: --inline-mult VOptionBool m_makeDepend; // main switch: -MMD - int m_maxNumWidth; // main switch: --max-num-width - int m_moduleRecursion;// main switch: --module-recursion-depth - int m_outputSplit; // main switch: --output-split - int m_outputSplitCFuncs;// main switch: --output-split-cfuncs - int m_outputSplitCTrace;// main switch: --output-split-ctrace - int m_pinsBv; // main switch: --pins-bv + int m_maxNumWidth = 65536; // main switch: --max-num-width + int m_moduleRecursion = 100; // main switch: --module-recursion-depth + int m_outputSplit = 20000; // main switch: --output-split + int m_outputSplitCFuncs = -1; // main switch: --output-split-cfuncs + int m_outputSplitCTrace = -1; // main switch: --output-split-ctrace + int m_pinsBv = 65; // main switch: --pins-bv VOptionBool m_skipIdentical; // main switch: --skip-identical - int m_threads; // main switch: --threads (0 == --no-threads) - int m_threadsMaxMTasks; // main switch: --threads-max-mtasks + int m_threads = 0; // main switch: --threads (0 == --no-threads) + int m_threadsMaxMTasks = 0; // main switch: --threads-max-mtasks VTimescale m_timeDefaultPrec; // main switch: --timescale VTimescale m_timeDefaultUnit; // main switch: --timescale VTimescale m_timeOverridePrec; // main switch: --timescale-override VTimescale m_timeOverrideUnit; // main switch: --timescale-override - int m_traceDepth; // main switch: --trace-depth + int m_traceDepth = 0; // main switch: --trace-depth TraceFormat m_traceFormat; // main switch: --trace or --trace-fst - int m_traceMaxArray;// main switch: --trace-max-array - int m_traceMaxWidth;// main switch: --trace-max-width - int m_traceThreads; // main switch: --trace-threads - int m_unrollCount; // main switch: --unroll-count - int m_unrollStmts; // main switch: --unroll-stmts + int m_traceMaxArray = 32; // main switch: --trace-max-array + int m_traceMaxWidth = 256; // main switch: --trace-max-width + int m_traceThreads = 0; // main switch: --trace-threads + int m_unrollCount = 64; // main switch: --unroll-count + int m_unrollStmts = 30000; // main switch: --unroll-stmts - int m_compLimitBlocks; // compiler selection; number of nested blocks - int m_compLimitMembers; // compiler selection; number of members in struct before make anon array - int m_compLimitParens; // compiler selection; number of nested parens + int m_compLimitBlocks = 0; // compiler selection; number of nested blocks + int m_compLimitMembers = 64; // compiler selection; number of members in struct before make anon array + int m_compLimitParens = 0; // compiler selection; number of nested parens string m_bin; // main switch: --bin {binary} string m_exeName; // main switch: -o {name} diff --git a/src/V3Order.cpp b/src/V3Order.cpp index 067725491..b87230714 100644 --- a/src/V3Order.cpp +++ b/src/V3Order.cpp @@ -138,8 +138,8 @@ private: public: OrderMoveDomScope(const AstSenTree* domainp, const AstScope* scopep) - : m_domainp(domainp) - , m_scopep(scopep) {} + : m_domainp{domainp} + , m_scopep{scopep} {} OrderMoveDomScope* readyDomScopeNextp() const { return m_readyDomScopeE.nextp(); } const AstSenTree* domainp() const { return m_domainp; } const AstScope* scopep() const { return m_scopep; } @@ -253,12 +253,12 @@ struct OrderVarFanoutCmp { // class OrderClkMarkVisitor : public AstNVisitor { private: - bool m_hasClk; // flag indicating whether there is clock signal on rhs - bool m_inClocked; // Currently inside a sequential block + bool m_hasClk = false; // flag indicating whether there is clock signal on rhs + bool m_inClocked = false; // Currently inside a sequential block bool m_newClkMarked; // Flag for deciding whether a new run is needed - bool m_inAss; // Currently inside of a assignment - int m_childClkWidth; // If in hasClk, width of clock signal in child - int m_rightClkWidth; // Clk width on the RHS + bool m_inAss = false; // Currently inside of a assignment + int m_childClkWidth = 0; // If in hasClk, width of clock signal in child + int m_rightClkWidth = 0; // Clk width on the RHS // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -360,11 +360,6 @@ private: public: // CONSTRUCTORS explicit OrderClkMarkVisitor(AstNode* nodep) { - m_hasClk = false; - m_inClocked = false; - m_inAss = false; - m_childClkWidth = 0; - m_rightClkWidth = 0; do { m_newClkMarked = false; iterate(nodep); @@ -378,7 +373,7 @@ public: class OrderClkAssVisitor : public AstNVisitor { private: - bool m_clkAss; // There is signals marked as clocker in the assignment + bool m_clkAss = false; // There is signals marked as clocker in the assignment // METHODS VL_DEBUG_FUNC; // Declare debug() virtual void visit(AstNodeAssign* nodep) override { @@ -400,10 +395,7 @@ private: public: // CONSTRUCTORS - explicit OrderClkAssVisitor(AstNode* nodep) { - m_clkAss = false; - iterate(nodep); - } + explicit OrderClkAssVisitor(AstNode* nodep) { iterate(nodep); } virtual ~OrderClkAssVisitor() override {} // METHODS bool isClkAss() { return m_clkAss; } @@ -461,9 +453,9 @@ public: ProcessMoveBuildGraph(const V3Graph* logicGraphp, // Input graph of OrderLogicVertex etc. V3Graph* outGraphp, // Output graph of T_MoveVertex's MoveVertexMaker* vxMakerp) - : m_graphp(logicGraphp) - , m_outGraphp(outGraphp) - , m_vxMakerp(vxMakerp) {} + : m_graphp{logicGraphp} + , m_outGraphp{outGraphp} + , m_vxMakerp{vxMakerp} {} virtual ~ProcessMoveBuildGraph() {} // METHODS @@ -566,8 +558,8 @@ class OrderMoveVertexMaker : public ProcessMoveBuildGraph::Move public: // CONSTRUCTORS OrderMoveVertexMaker(V3Graph* pomGraphp, V3List* pomWaitingp) - : m_pomGraphp(pomGraphp) - , m_pomWaitingp(pomWaitingp) {} + : m_pomGraphp{pomGraphp} + , m_pomWaitingp{pomWaitingp} {} // METHODS OrderMoveVertex* makeVertexp(OrderLogicVertex* lvertexp, const OrderEitherVertex*, const AstScope* scopep, const AstSenTree* domainp) { @@ -590,7 +582,7 @@ class OrderMTaskMoveVertexMaker : public ProcessMoveBuildGraph: public: explicit OrderMTaskMoveVertexMaker(V3Graph* pomGraphp) - : m_pomGraphp(pomGraphp) {} + : m_pomGraphp{pomGraphp} {} MTaskMoveVertex* makeVertexp(OrderLogicVertex* lvertexp, const OrderEitherVertex* varVertexp, const AstScope* scopep, const AstSenTree* domainp) { // Exclude initial/settle logic from the mtasks graph. diff --git a/src/V3OrderGraph.h b/src/V3OrderGraph.h index 10781196f..e34cd8763 100644 --- a/src/V3OrderGraph.h +++ b/src/V3OrderGraph.h @@ -127,17 +127,17 @@ class OrderEitherVertex : public V3GraphVertex { bool m_isFromInput; // From input, or derived therefrom (conservatively false) protected: OrderEitherVertex(V3Graph* graphp, const OrderEitherVertex& old) - : V3GraphVertex(graphp, old) - , m_scopep(old.m_scopep) - , m_domainp(old.m_domainp) - , m_isFromInput(old.m_isFromInput) {} + : V3GraphVertex{graphp, old} + , m_scopep{old.m_scopep} + , m_domainp{old.m_domainp} + , m_isFromInput{old.m_isFromInput} {} public: OrderEitherVertex(V3Graph* graphp, AstScope* scopep, AstSenTree* domainp) - : V3GraphVertex(graphp) - , m_scopep(scopep) - , m_domainp(domainp) - , m_isFromInput(false) {} + : V3GraphVertex{graphp} + , m_scopep{scopep} + , m_domainp{domainp} + , m_isFromInput{false} {} virtual ~OrderEitherVertex() override {} virtual OrderEitherVertex* clone(V3Graph* graphp) const override = 0; // Methods @@ -154,11 +154,11 @@ public: class OrderInputsVertex : public OrderEitherVertex { OrderInputsVertex(V3Graph* graphp, const OrderInputsVertex& old) - : OrderEitherVertex(graphp, old) {} + : OrderEitherVertex{graphp, old} {} public: OrderInputsVertex(V3Graph* graphp, AstSenTree* domainp) - : OrderEitherVertex(graphp, nullptr, domainp) { + : OrderEitherVertex{graphp, nullptr, domainp} { isFromInput(true); // By definition } virtual ~OrderInputsVertex() override {} @@ -177,13 +177,13 @@ class OrderLogicVertex : public OrderEitherVertex { protected: OrderLogicVertex(V3Graph* graphp, const OrderLogicVertex& old) - : OrderEitherVertex(graphp, old) - , m_nodep(old.m_nodep) {} + : OrderEitherVertex{graphp, old} + , m_nodep{old.m_nodep} {} public: OrderLogicVertex(V3Graph* graphp, AstScope* scopep, AstSenTree* domainp, AstNode* nodep) - : OrderEitherVertex(graphp, scopep, domainp) - , m_nodep(nodep) {} + : OrderEitherVertex{graphp, scopep, domainp} + , m_nodep{nodep} {} virtual ~OrderLogicVertex() override {} virtual OrderLogicVertex* clone(V3Graph* graphp) const override { return new OrderLogicVertex(graphp, *this); @@ -204,17 +204,17 @@ class OrderVarVertex : public OrderEitherVertex { bool m_isDelayed; // Set in a delayed assignment protected: OrderVarVertex(V3Graph* graphp, const OrderVarVertex& old) - : OrderEitherVertex(graphp, old) - , m_varScp(old.m_varScp) - , m_isClock(old.m_isClock) - , m_isDelayed(old.m_isDelayed) {} + : OrderEitherVertex{graphp, old} + , m_varScp{old.m_varScp} + , m_isClock{old.m_isClock} + , m_isDelayed{old.m_isDelayed} {} public: OrderVarVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) - : OrderEitherVertex(graphp, scopep, nullptr) - , m_varScp(varScp) - , m_isClock(false) - , m_isDelayed(false) {} + : OrderEitherVertex{graphp, scopep, nullptr} + , m_varScp{varScp} + , m_isClock{false} + , m_isDelayed{false} {} virtual ~OrderVarVertex() override {} virtual OrderVarVertex* clone(V3Graph* graphp) const override = 0; virtual OrderVEdgeType type() const override = 0; @@ -229,11 +229,11 @@ public: class OrderVarStdVertex : public OrderVarVertex { OrderVarStdVertex(V3Graph* graphp, const OrderVarStdVertex& old) - : OrderVarVertex(graphp, old) {} + : OrderVarVertex{graphp, old} {} public: OrderVarStdVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) - : OrderVarVertex(graphp, scopep, varScp) {} + : OrderVarVertex{graphp, scopep, varScp} {} virtual ~OrderVarStdVertex() override {} virtual OrderVarStdVertex* clone(V3Graph* graphp) const override { return new OrderVarStdVertex(graphp, *this); @@ -247,11 +247,11 @@ public: }; class OrderVarPreVertex : public OrderVarVertex { OrderVarPreVertex(V3Graph* graphp, const OrderVarPreVertex& old) - : OrderVarVertex(graphp, old) {} + : OrderVarVertex{graphp, old} {} public: OrderVarPreVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) - : OrderVarVertex(graphp, scopep, varScp) {} + : OrderVarVertex{graphp, scopep, varScp} {} virtual ~OrderVarPreVertex() override {} virtual OrderVarPreVertex* clone(V3Graph* graphp) const override { return new OrderVarPreVertex(graphp, *this); @@ -265,11 +265,11 @@ public: }; class OrderVarPostVertex : public OrderVarVertex { OrderVarPostVertex(V3Graph* graphp, const OrderVarPostVertex& old) - : OrderVarVertex(graphp, old) {} + : OrderVarVertex{graphp, old} {} public: OrderVarPostVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) - : OrderVarVertex(graphp, scopep, varScp) {} + : OrderVarVertex{graphp, scopep, varScp} {} virtual OrderVarPostVertex* clone(V3Graph* graphp) const override { return new OrderVarPostVertex(graphp, *this); } @@ -283,11 +283,11 @@ public: }; class OrderVarPordVertex : public OrderVarVertex { OrderVarPordVertex(V3Graph* graphp, const OrderVarPordVertex& old) - : OrderVarVertex(graphp, old) {} + : OrderVarVertex{graphp, old} {} public: OrderVarPordVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) - : OrderVarVertex(graphp, scopep, varScp) {} + : OrderVarVertex{graphp, scopep, varScp} {} virtual ~OrderVarPordVertex() override {} virtual OrderVarPordVertex* clone(V3Graph* graphp) const override { return new OrderVarPordVertex(graphp, *this); @@ -301,11 +301,11 @@ public: }; class OrderVarSettleVertex : public OrderVarVertex { OrderVarSettleVertex(V3Graph* graphp, const OrderVarSettleVertex& old) - : OrderVarVertex(graphp, old) {} + : OrderVarVertex{graphp, old} {} public: OrderVarSettleVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) - : OrderVarVertex(graphp, scopep, varScp) {} + : OrderVarVertex{graphp, scopep, varScp} {} virtual ~OrderVarSettleVertex() override {} virtual OrderVarSettleVertex* clone(V3Graph* graphp) const override { return new OrderVarSettleVertex(graphp, *this); @@ -338,10 +338,10 @@ protected: public: // CONSTRUCTORS OrderMoveVertex(V3Graph* graphp, OrderLogicVertex* logicp) - : V3GraphVertex(graphp) - , m_logicp(logicp) - , m_state(POM_WAIT) - , m_domScopep(nullptr) {} + : V3GraphVertex{graphp} + , m_logicp{logicp} + , m_state{POM_WAIT} + , m_domScopep{nullptr} {} virtual ~OrderMoveVertex() override {} virtual OrderMoveVertex* clone(V3Graph* graphp) const override { v3fatalSrc("Unsupported"); @@ -405,11 +405,11 @@ protected: public: MTaskMoveVertex(V3Graph* graphp, OrderLogicVertex* logicp, const OrderEitherVertex* varp, const AstScope* scopep, const AstSenTree* domainp) - : V3GraphVertex(graphp) - , m_logicp(logicp) - , m_varp(varp) - , m_scopep(scopep) - , m_domainp(domainp) { + : V3GraphVertex{graphp} + , m_logicp{logicp} + , m_varp{varp} + , m_scopep{scopep} + , m_domainp{domainp} { UASSERT(!(logicp && varp), "MTaskMoveVertex: logicp and varp may not both be set!\n"); } virtual ~MTaskMoveVertex() override {} @@ -451,12 +451,12 @@ public: class OrderEdge : public V3GraphEdge { protected: OrderEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, const OrderEdge& old) - : V3GraphEdge(graphp, fromp, top, old) {} + : V3GraphEdge{graphp, fromp, top, old} {} public: OrderEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, int weight, bool cutable = false) - : V3GraphEdge(graphp, fromp, top, weight, cutable) {} + : V3GraphEdge{graphp, fromp, top, weight, cutable} {} virtual ~OrderEdge() override {} virtual OrderVEdgeType type() const { return OrderVEdgeType::EDGE_STD; } virtual OrderEdge* clone(V3Graph* graphp, V3GraphVertex* fromp, @@ -479,11 +479,11 @@ class OrderComboCutEdge : public OrderEdge { // in which case we'll need a change detect loop around this var. OrderComboCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, const OrderComboCutEdge& old) - : OrderEdge(graphp, fromp, top, old) {} + : OrderEdge{graphp, fromp, top, old} {} public: OrderComboCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) - : OrderEdge(graphp, fromp, top, WEIGHT_COMBO, CUTABLE) {} + : OrderEdge{graphp, fromp, top, WEIGHT_COMBO, CUTABLE} {} virtual OrderVEdgeType type() const override { return OrderVEdgeType::EDGE_COMBOCUT; } virtual ~OrderComboCutEdge() override {} virtual OrderComboCutEdge* clone(V3Graph* graphp, V3GraphVertex* fromp, @@ -500,11 +500,11 @@ class OrderPostCutEdge : public OrderEdge { // in which case we'll need a change detect loop around this var. OrderPostCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, const OrderPostCutEdge& old) - : OrderEdge(graphp, fromp, top, old) {} + : OrderEdge{graphp, fromp, top, old} {} public: OrderPostCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) - : OrderEdge(graphp, fromp, top, WEIGHT_COMBO, CUTABLE) {} + : OrderEdge{graphp, fromp, top, WEIGHT_COMBO, CUTABLE} {} virtual OrderVEdgeType type() const override { return OrderVEdgeType::EDGE_POSTCUT; } virtual ~OrderPostCutEdge() override {} virtual OrderPostCutEdge* clone(V3Graph* graphp, V3GraphVertex* fromp, @@ -521,11 +521,11 @@ class OrderPreCutEdge : public OrderEdge { // in which case we can't optimize away the pre/post delayed assignments OrderPreCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, const OrderPreCutEdge& old) - : OrderEdge(graphp, fromp, top, old) {} + : OrderEdge{graphp, fromp, top, old} {} public: OrderPreCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) - : OrderEdge(graphp, fromp, top, WEIGHT_PRE, CUTABLE) {} + : OrderEdge{graphp, fromp, top, WEIGHT_PRE, CUTABLE} {} virtual OrderVEdgeType type() const override { return OrderVEdgeType::EDGE_PRECUT; } virtual OrderPreCutEdge* clone(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) const override { diff --git a/src/V3Param.cpp b/src/V3Param.cpp index 14181aef1..ab46e7bf7 100644 --- a/src/V3Param.cpp +++ b/src/V3Param.cpp @@ -222,14 +222,15 @@ private: struct ModInfo { AstNodeModule* m_modp; // Module with specified name CloneMap m_cloneMap; // Map of old-varp -> new cloned varp - explicit ModInfo(AstNodeModule* modp) { m_modp = modp; } + explicit ModInfo(AstNodeModule* modp) + : m_modp{modp} {} }; typedef std::map ModNameMap; ModNameMap m_modNameMap; // Hash of created module flavors by name typedef std::map LongMap; LongMap m_longMap; // Hash of very long names to unique identity number - int m_longId; + int m_longId = 0; // All module names that are loaded from source code // Generated modules by this visitor is not included @@ -238,7 +239,7 @@ private: typedef std::pair ValueMapValue; typedef std::map ValueMap; ValueMap m_valueMap; // Hash of node hash to (param value, name) - int m_nextValue; // Next value to use in m_valueMap + int m_nextValue = 1; // Next value to use in m_valueMap typedef std::multimap LevelModMap; LevelModMap m_todoModps; // Modules left to process @@ -246,14 +247,10 @@ private: typedef std::deque CellList; CellList m_cellps; // Cells left to process (in this module) - AstNodeFTask* m_ftaskp; // Function/task reference - - AstNodeModule* m_modp; // Current module being processed - + AstNodeFTask* m_ftaskp = nullptr; // Function/task reference + AstNodeModule* m_modp = nullptr; // Current module being processed string m_unlinkedTxt; // Text for AstUnlinkedRef - UnrollStateful m_unroller; // Loop unroller - string m_generateHierName; // Generate portion of hierarchy name // Database to get protect-lib wrapper that matches parameters in hierarchical Verilation @@ -784,11 +781,7 @@ private: public: // CONSTRUCTORS explicit ParamVisitor(AstNetlist* nodep) - : m_hierBlocks(v3Global.opt.hierBlocks(), nodep) { - m_longId = 0; - m_ftaskp = nullptr; - m_modp = nullptr; - m_nextValue = 1; + : m_hierBlocks{v3Global.opt.hierBlocks(), nodep} { for (AstNodeModule* modp = nodep->modulesp(); modp; modp = VN_CAST(modp->nextp(), NodeModule)) { m_allModuleNames.insert(modp->name()); diff --git a/src/V3ParseImp.h b/src/V3ParseImp.h index ac26a6ca3..88ceed67d 100644 --- a/src/V3ParseImp.h +++ b/src/V3ParseImp.h @@ -301,9 +301,9 @@ public: public: // CONSTRUCTORS V3ParseImp(AstNetlist* rootp, VInFilter* filterp, V3ParseSym* parserSymp) - : m_rootp(rootp) - , m_filterp(filterp) - , m_symp(parserSymp) { + : m_rootp{rootp} + , m_filterp{filterp} + , m_symp{parserSymp} { m_lexFileline = nullptr; m_lexerp = nullptr; m_inLibrary = false; diff --git a/src/V3ParseLex.cpp b/src/V3ParseLex.cpp index 6b316ff18..9ec3731b2 100644 --- a/src/V3ParseLex.cpp +++ b/src/V3ParseLex.cpp @@ -36,7 +36,7 @@ class V3Lexer : public V3LexerBase { public: // CONSTRUCTORS V3Lexer() - : V3LexerBase(nullptr) {} + : V3LexerBase{nullptr} {} ~V3Lexer() {} // METHODS void unputString(const char* textp, size_t length) { diff --git a/src/V3ParseSym.h b/src/V3ParseSym.h index 4462a5c38..660b38cc9 100644 --- a/src/V3ParseSym.h +++ b/src/V3ParseSym.h @@ -38,17 +38,16 @@ private: // MEMBERS static int s_anonNum; // Number of next anonymous object (parser use only) VSymGraph m_syms; // Graph of symbol tree - VSymEnt* m_symTableNextId; // Symbol table for next lexer lookup (parser use only) + VSymEnt* m_symTableNextId = nullptr; // Symbol table for next lexer lookup (parser use only) VSymEnt* m_symCurrentp; // Active symbol table for additions/lookups SymStack m_sympStack; // Stack of upper nodes with pending symbol tables public: // CONSTRUCTORS explicit V3ParseSym(AstNetlist* rootp) - : m_syms(rootp) { + : m_syms{rootp} { s_anonNum = 0; // Number of next anonymous object pushScope(findNewTable(rootp)); - m_symTableNextId = nullptr; m_symCurrentp = symCurrentp(); } ~V3ParseSym() {} diff --git a/src/V3Partition.cpp b/src/V3Partition.cpp index 604229780..ae4df51f4 100644 --- a/src/V3Partition.cpp +++ b/src/V3Partition.cpp @@ -195,10 +195,10 @@ public: // CONSTRUCTORS PartPropagateCp(V3Graph* graphp, GraphWay way, T_CostAccessor* accessp, bool slowAsserts, V3EdgeFuncP edgeFuncp = &V3GraphEdge::followAlwaysTrue) - : GraphAlg<>(graphp, edgeFuncp) - , m_way(way) - , m_accessp(accessp) - , m_slowAsserts(slowAsserts) {} + : GraphAlg<>{graphp, edgeFuncp} + , m_way{way} + , m_accessp{accessp} + , m_slowAsserts{slowAsserts} {} // METHODS void cpHasIncreased(V3GraphVertex* vxp, uint32_t newInclusiveCp) { @@ -472,7 +472,7 @@ private: public: // CONSTRUCTORS LogicMTask(V3Graph* graphp, MTaskMoveVertex* mtmvVxp) - : AbstractLogicMTask(graphp) { + : AbstractLogicMTask{graphp} { for (int i = 0; i < GraphWay::NUM_WAYS; ++i) m_critPathCost[i] = 0; if (mtmvVxp) { // Else null for test m_vertices.push_back(mtmvVxp); @@ -784,7 +784,7 @@ class MTaskEdge : public V3GraphEdge, public MergeCandidate { public: // CONSTRUCTORS MTaskEdge(V3Graph* graphp, LogicMTask* fromp, LogicMTask* top, int weight) - : V3GraphEdge(graphp, fromp, top, weight) { + : V3GraphEdge{graphp, fromp, top, weight} { fromp->addRelative(GraphWay::FORWARD, top); top->addRelative(GraphWay::REVERSE, fromp); } @@ -860,7 +860,7 @@ class PartParallelismEst { public: // CONSTRUCTORS explicit PartParallelismEst(const V3Graph* graphp) - : m_graphp(graphp) {} + : m_graphp{graphp} {} // METHODS uint32_t totalGraphCost() const { return m_totalGraphCost; } @@ -1084,10 +1084,10 @@ private: public: // CONSTRUCTORS PartContraction(V3Graph* mtasksp, uint32_t scoreLimit, bool slowAsserts) - : m_mtasksp(mtasksp) - , m_scoreLimit(scoreLimit) - , m_slowAsserts(slowAsserts) - , m_sb(&mergeCandidateScore, slowAsserts) {} + : m_mtasksp{mtasksp} + , m_scoreLimit{scoreLimit} + , m_slowAsserts{slowAsserts} + , m_sb{&mergeCandidateScore, slowAsserts} {} // METHODS void go() { @@ -1789,12 +1789,11 @@ private: // MEMBERS V3Graph* m_mtasksp; // Mtask graph Olv2MTaskMap m_olv2mtask; // Map OrderLogicVertex to LogicMTask who wraps it - unsigned m_mergesDone; // Number of MTasks merged. For stats only. + unsigned m_mergesDone = 0; // Number of MTasks merged. For stats only. public: // CONSTRUCTORs explicit PartFixDataHazards(V3Graph* mtasksp) - : m_mtasksp(mtasksp) - , m_mergesDone(0) {} + : m_mtasksp{mtasksp} {} // METHODS private: void findAdjacentTasks(OvvSet::iterator ovvIt, TasksByRank* tasksByRankp) { @@ -2073,11 +2072,11 @@ public: // CONSTRUCTORS explicit PartPackMTasks(V3Graph* mtasksp, uint32_t nThreads = v3Global.opt.threads(), unsigned sandbagNumerator = 30, unsigned sandbagDenom = 100) - : m_mtasksp(mtasksp) - , m_nThreads(nThreads) - , m_sandbagNumerator(sandbagNumerator) - , m_sandbagDenom(sandbagDenom) - , m_ready(m_mtaskCmp) {} + : m_mtasksp{mtasksp} + , m_nThreads{nThreads} + , m_sandbagNumerator{sandbagNumerator} + , m_sandbagDenom{sandbagDenom} + , m_ready{m_mtaskCmp} {} ~PartPackMTasks() {} // METHODS diff --git a/src/V3Partition.h b/src/V3Partition.h index 3ca944c49..dde438302 100644 --- a/src/V3Partition.h +++ b/src/V3Partition.h @@ -40,7 +40,7 @@ class V3Partition { public: // CONSTRUCTORS explicit V3Partition(V3Graph* fineDepsGraphp) - : m_fineDepsGraphp(fineDepsGraphp) {} + : m_fineDepsGraphp{fineDepsGraphp} {} ~V3Partition() {} // METHODS diff --git a/src/V3PartitionGraph.h b/src/V3PartitionGraph.h index 300bd911c..d79fa83e7 100644 --- a/src/V3PartitionGraph.h +++ b/src/V3PartitionGraph.h @@ -31,7 +31,7 @@ class AbstractMTask : public V3GraphVertex { public: AbstractMTask(V3Graph* graphp) - : V3GraphVertex(graphp) {} + : V3GraphVertex{graphp} {} virtual ~AbstractMTask() override {} virtual uint32_t id() const = 0; virtual uint32_t cost() const = 0; @@ -43,7 +43,7 @@ public: typedef std::list VxList; // CONSTRUCTORS AbstractLogicMTask(V3Graph* graphp) - : AbstractMTask(graphp) {} + : AbstractMTask{graphp} {} virtual ~AbstractLogicMTask() override {} // METHODS // Set of logic vertices in this mtask. Order is not significant. @@ -69,9 +69,9 @@ private: public: ExecMTask(V3Graph* graphp, AstMTaskBody* bodyp, uint32_t id) - : AbstractMTask(graphp) - , m_bodyp(bodyp) - , m_id(id) {} + : AbstractMTask{graphp} + , m_bodyp{bodyp} + , m_id{id} {} AstMTaskBody* bodyp() const { return m_bodyp; } virtual uint32_t id() const override { return m_id; } uint32_t priority() const { return m_priority; } diff --git a/src/V3PreLex.h b/src/V3PreLex.h index 6a8aa2976..34f978de0 100644 --- a/src/V3PreLex.h +++ b/src/V3PreLex.h @@ -136,8 +136,8 @@ public: bool m_file = false; // Buffer is start of new file int m_termState = 0; // Termination fsm VPreStream(FileLine* fl, V3PreLex* lexp) - : m_curFilelinep(fl) - , m_lexp(lexp) { + : m_curFilelinep{fl} + , m_lexp{lexp} { lexStreamDepthAdd(1); } ~VPreStream() { lexStreamDepthAdd(-1); } @@ -173,8 +173,8 @@ public: // Used only by V3PreLex.cpp and V3PreProc.cpp // CONSTRUCTORS V3PreLex(V3PreProcImp* preimpp, FileLine* filelinep) - : m_preimpp(preimpp) - , m_tokFilelinep(filelinep) { + : m_preimpp{preimpp} + , m_tokFilelinep{filelinep} { initFirstBuffer(filelinep); } ~V3PreLex() { diff --git a/src/V3PreProc.cpp b/src/V3PreProc.cpp index 068452988..1adbf78de 100644 --- a/src/V3PreProc.cpp +++ b/src/V3PreProc.cpp @@ -51,10 +51,10 @@ class VDefine { bool m_cmdline; // Set on command line, don't `undefineall public: VDefine(FileLine* fl, const string& value, const string& params, bool cmdline) - : m_fileline(fl) - , m_value(value) - , m_params(params) - , m_cmdline(cmdline) {} + : m_fileline{fl} + , m_value{value} + , m_params{params} + , m_cmdline{cmdline} {} FileLine* fileline() const { return m_fileline; } string value() const { return m_value; } string params() const { return m_params; } @@ -80,8 +80,8 @@ public: void parenLevel(int value) { m_parenLevel = value; } std::vector& args() { return m_args; } VDefineRef(const string& name, const string& params) - : m_name(name) - , m_params(params) {} + : m_name{name} + , m_params{params} {} ~VDefineRef() {} }; @@ -96,8 +96,8 @@ public: bool on() const { return m_on; } bool everOn() const { return m_everOn; } VPreIfEntry(bool on, bool everOn) - : m_on(on) - , m_everOn(everOn || on) {} // Note everOn includes new state + : m_on{on} + , m_everOn{everOn || on} {} // Note everOn includes new state ~VPreIfEntry() {} }; diff --git a/src/V3Premit.cpp b/src/V3Premit.cpp index 4ba30324e..69f8d7ba5 100644 --- a/src/V3Premit.cpp +++ b/src/V3Premit.cpp @@ -43,7 +43,7 @@ private: AstUser4InUse m_inuser4; // STATE - bool m_noopt; // Disable optimization of variables in this block + bool m_noopt = false; // Disable optimization of variables in this block // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -73,7 +73,6 @@ public: // CONSTRUCTORS explicit PremitAssignVisitor(AstNodeAssign* nodep) { UINFO(4, " PremitAssignVisitor on " << nodep << endl); - m_noopt = false; iterate(nodep); } virtual ~PremitAssignVisitor() override {} @@ -94,12 +93,12 @@ private: AstUser2InUse m_inuser2; // STATE - AstNodeModule* m_modp; // Current module - AstCFunc* m_funcp; // Current block - AstNode* m_stmtp; // Current statement - AstWhile* m_inWhilep; // Inside while loop, special statement additions - AstTraceInc* m_inTracep; // Inside while loop, special statement additions - bool m_assignLhs; // Inside assignment lhs, don't breakup extracts + AstNodeModule* m_modp = nullptr; // Current module + AstCFunc* m_funcp = nullptr; // Current block + AstNode* m_stmtp = nullptr; // Current statement + AstWhile* m_inWhilep = nullptr; // Inside while loop, special statement additions + AstTraceInc* m_inTracep = nullptr; // Inside while loop, special statement additions + bool m_assignLhs = false; // Inside assignment lhs, don't breakup extracts // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -399,15 +398,7 @@ private: public: // CONSTRUCTORS - explicit PremitVisitor(AstNetlist* nodep) { - m_modp = nullptr; - m_funcp = nullptr; - m_stmtp = nullptr; - m_inWhilep = nullptr; - m_inTracep = nullptr; - m_assignLhs = false; - iterate(nodep); - } + explicit PremitVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~PremitVisitor() override {} }; diff --git a/src/V3ProtectLib.cpp b/src/V3ProtectLib.cpp index 7bc496b1d..b889bd48a 100644 --- a/src/V3ProtectLib.cpp +++ b/src/V3ProtectLib.cpp @@ -486,8 +486,8 @@ private: public: explicit ProtectVisitor(AstNode* nodep) - : m_libName(v3Global.opt.protectLib()) - , m_topName(v3Global.opt.prefix()) { + : m_libName{v3Global.opt.protectLib()} + , m_topName{v3Global.opt.prefix()} { iterate(nodep); } }; diff --git a/src/V3Reloop.cpp b/src/V3Reloop.cpp index 540616b4d..1579d7e1e 100644 --- a/src/V3Reloop.cpp +++ b/src/V3Reloop.cpp @@ -55,18 +55,18 @@ private: // STATE VDouble0 m_statReloops; // Statistic tracking VDouble0 m_statReItems; // Statistic tracking - AstCFunc* m_cfuncp; // Current block + AstCFunc* m_cfuncp = nullptr; // Current block AssVec m_mgAssignps; // List of assignments merging - AstCFunc* m_mgCfuncp; // Parent C function - AstNode* m_mgNextp; // Next node - AstNodeSel* m_mgSelLp; // Parent select, nullptr = idle - AstNodeSel* m_mgSelRp; // Parent select, nullptr = constant - AstNodeVarRef* m_mgVarrefLp; // Parent varref - AstNodeVarRef* m_mgVarrefRp; // Parent varref, nullptr = constant - AstConst* m_mgConstRp; // Parent RHS constant, nullptr = sel - uint32_t m_mgIndexLo; // Merge range - uint32_t m_mgIndexHi; // Merge range + AstCFunc* m_mgCfuncp = nullptr; // Parent C function + AstNode* m_mgNextp = nullptr; // Next node + AstNodeSel* m_mgSelLp = nullptr; // Parent select, nullptr = idle + AstNodeSel* m_mgSelRp = nullptr; // Parent select, nullptr = constant + AstNodeVarRef* m_mgVarrefLp = nullptr; // Parent varref + AstNodeVarRef* m_mgVarrefRp = nullptr; // Parent varref, nullptr = constant + AstConst* m_mgConstRp = nullptr; // Parent RHS constant, nullptr = sel + uint32_t m_mgIndexLo = 0; // Merge range + uint32_t m_mgIndexHi = 0; // Merge range // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -238,19 +238,7 @@ private: public: // CONSTRUCTORS - explicit ReloopVisitor(AstNetlist* nodep) { - m_cfuncp = nullptr; - m_mgCfuncp = nullptr; - m_mgNextp = nullptr; - m_mgSelLp = nullptr; - m_mgSelRp = nullptr; - m_mgVarrefLp = nullptr; - m_mgVarrefRp = nullptr; - m_mgConstRp = nullptr; - m_mgIndexLo = 0; - m_mgIndexHi = 0; - iterate(nodep); - } + explicit ReloopVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~ReloopVisitor() override { V3Stats::addStat("Optimizations, Reloops", m_statReloops); V3Stats::addStat("Optimizations, Reloop iterations", m_statReItems); diff --git a/src/V3Scope.cpp b/src/V3Scope.cpp index c33ca3029..2e8207222 100644 --- a/src/V3Scope.cpp +++ b/src/V3Scope.cpp @@ -51,11 +51,11 @@ private: typedef std::set> VarRefScopeSet; // STATE, inside processing a single module - AstNodeModule* m_modp; // Current module - AstScope* m_scopep; // Current scope we are building + AstNodeModule* m_modp = nullptr; // Current module + AstScope* m_scopep = nullptr; // Current scope we are building // STATE, for passing down one level of hierarchy (may need save/restore) - AstCell* m_aboveCellp; // Cell that instantiates this module - AstScope* m_aboveScopep; // Scope that instantiates this scope + AstCell* m_aboveCellp = nullptr; // Cell that instantiates this module + AstScope* m_aboveScopep = nullptr; // Scope that instantiates this scope PackageScopeMap m_packageScopes; // Scopes for each package VarScopeMap m_varScopes; // Varscopes created for each scope and var @@ -320,14 +320,7 @@ private: public: // CONSTRUCTORS - explicit ScopeVisitor(AstNetlist* nodep) { - m_aboveCellp = nullptr; - m_aboveScopep = nullptr; - m_modp = nullptr; - m_scopep = nullptr; - // - iterate(nodep); - } + explicit ScopeVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~ScopeVisitor() override {} }; @@ -337,7 +330,7 @@ public: class ScopeCleanupVisitor : public AstNVisitor { private: // STATE - AstScope* m_scopep; // Current scope we are building + AstScope* m_scopep = nullptr; // Current scope we are building // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -402,10 +395,7 @@ private: public: // CONSTRUCTORS - explicit ScopeCleanupVisitor(AstNetlist* nodep) { - m_scopep = nullptr; - iterate(nodep); - } + explicit ScopeCleanupVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~ScopeCleanupVisitor() override {} }; diff --git a/src/V3Scoreboard.cpp b/src/V3Scoreboard.cpp index 1151b9079..a4ffda454 100644 --- a/src/V3Scoreboard.cpp +++ b/src/V3Scoreboard.cpp @@ -26,7 +26,7 @@ public: uint32_t m_id; // CONSTRUCTORS explicit ScoreboardTestElem(uint32_t score) - : m_score(score) { + : m_score{score} { static uint32_t s_serial = 0; m_id = ++s_serial; } diff --git a/src/V3Scoreboard.h b/src/V3Scoreboard.h index 43ed4044f..f5933668d 100644 --- a/src/V3Scoreboard.h +++ b/src/V3Scoreboard.h @@ -72,18 +72,17 @@ public: typename KeySet::iterator m_keyIt; typename Val2Keys::iterator m_valIt; SortByValueMap* m_sbvmp; - bool m_end; // At the end() + bool m_end = true; // At the end() // CONSTRUCTORS explicit const_iterator(SortByValueMap* sbmvp) // for end() - : m_sbvmp(sbmvp) - , m_end(true) {} + : m_sbvmp{sbmvp} {} const_iterator(typename Val2Keys::iterator valIt, typename KeySet::iterator keyIt, SortByValueMap* sbvmp) - : m_keyIt(keyIt) - , m_valIt(valIt) - , m_sbvmp(sbvmp) - , m_end(false) {} + : m_keyIt{keyIt} + , m_valIt{valIt} + , m_sbvmp{sbvmp} + , m_end{false} {} // METHODS void advanceUntilValid() { @@ -204,10 +203,10 @@ public: // CONSTRUCTORS explicit iterator(SortByValueMap* sbvmp) - : const_iterator(sbvmp) {} + : const_iterator{sbvmp} {} iterator(typename Val2Keys::iterator valIt, typename KeySet::iterator keyIt, SortByValueMap* sbvmp) - : const_iterator(valIt, keyIt, sbvmp) {} + : const_iterator{valIt, keyIt, sbvmp} {} // METHODS iterator& operator++() { @@ -374,8 +373,8 @@ private: public: // CONSTRUCTORS explicit V3Scoreboard(UserScoreFnp scoreFnp, bool slowAsserts) - : m_scoreFnp(scoreFnp) - , m_slowAsserts(slowAsserts) {} + : m_scoreFnp{scoreFnp} + , m_slowAsserts{slowAsserts} {} ~V3Scoreboard() {} // METHODS diff --git a/src/V3Simulate.h b/src/V3Simulate.h index 901d1a5df..d8afa8e7c 100644 --- a/src/V3Simulate.h +++ b/src/V3Simulate.h @@ -55,8 +55,8 @@ public: V3TaskConnects* m_tconnects; // CONSTRUCTORS SimStackNode(AstFuncRef* funcp, V3TaskConnects* tconnects) - : m_funcp(funcp) - , m_tconnects(tconnects) {} + : m_funcp{funcp} + , m_tconnects{tconnects} {} ~SimStackNode() {} }; diff --git a/src/V3Slice.cpp b/src/V3Slice.cpp index ca44a4c2b..9730acdab 100644 --- a/src/V3Slice.cpp +++ b/src/V3Slice.cpp @@ -53,8 +53,8 @@ class SliceVisitor : public AstNVisitor { AstUser1InUse m_inuser1; // STATE - AstNode* m_assignp; // Assignment we are under - bool m_assignError; // True if the current assign already has an error + AstNode* m_assignp = nullptr; // Assignment we are under + bool m_assignError = false; // True if the current assign already has an error // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -224,11 +224,7 @@ class SliceVisitor : public AstNVisitor { public: // CONSTRUCTORS - explicit SliceVisitor(AstNetlist* nodep) { - m_assignp = nullptr; - m_assignError = false; - iterate(nodep); - } + explicit SliceVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~SliceVisitor() override {} }; diff --git a/src/V3Split.cpp b/src/V3Split.cpp index f4b317402..4fb8f7617 100644 --- a/src/V3Split.cpp +++ b/src/V3Split.cpp @@ -100,8 +100,8 @@ class SplitNodeVertex : public V3GraphVertex { protected: SplitNodeVertex(V3Graph* graphp, AstNode* nodep) - : V3GraphVertex(graphp) - , m_nodep(nodep) {} + : V3GraphVertex{graphp} + , m_nodep{nodep} {} virtual ~SplitNodeVertex() override {} // ACCESSORS // Do not make accessor for nodep(), It may change due to @@ -118,7 +118,7 @@ public: class SplitPliVertex : public SplitNodeVertex { public: explicit SplitPliVertex(V3Graph* graphp, AstNode* nodep) - : SplitNodeVertex(graphp, nodep) {} + : SplitNodeVertex{graphp, nodep} {} virtual ~SplitPliVertex() override {} virtual string name() const override { return "*PLI*"; } virtual string dotColor() const override { return "green"; } @@ -127,7 +127,7 @@ public: class SplitLogicVertex : public SplitNodeVertex { public: SplitLogicVertex(V3Graph* graphp, AstNode* nodep) - : SplitNodeVertex(graphp, nodep) {} + : SplitNodeVertex{graphp, nodep} {} virtual ~SplitLogicVertex() override {} virtual string dotColor() const override { return "yellow"; } }; @@ -135,7 +135,7 @@ public: class SplitVarStdVertex : public SplitNodeVertex { public: SplitVarStdVertex(V3Graph* graphp, AstNode* nodep) - : SplitNodeVertex(graphp, nodep) {} + : SplitNodeVertex{graphp, nodep} {} virtual ~SplitVarStdVertex() override {} virtual string dotColor() const override { return "skyblue"; } }; @@ -143,7 +143,7 @@ public: class SplitVarPostVertex : public SplitNodeVertex { public: SplitVarPostVertex(V3Graph* graphp, AstNode* nodep) - : SplitNodeVertex(graphp, nodep) {} + : SplitNodeVertex{graphp, nodep} {} virtual ~SplitVarPostVertex() override {} virtual string name() const override { return string("POST ") + SplitNodeVertex::name(); } virtual string dotColor() const override { return "CadetBlue"; } @@ -159,7 +159,7 @@ protected: enum { WEIGHT_NORMAL = 10 }; SplitEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, int weight, bool cutable = CUTABLE) - : V3GraphEdge(graphp, fromp, top, weight, cutable) {} + : V3GraphEdge{graphp, fromp, top, weight, cutable} {} virtual ~SplitEdge() override {} public: @@ -188,7 +188,7 @@ uint32_t SplitEdge::s_stepNum = 0; class SplitPostEdge : public SplitEdge { public: SplitPostEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) - : SplitEdge(graphp, fromp, top, WEIGHT_NORMAL) {} + : SplitEdge{graphp, fromp, top, WEIGHT_NORMAL} {} virtual ~SplitPostEdge() override {} virtual bool followScoreboard() const override { return false; } virtual string dotColor() const override { return "khaki"; } @@ -197,7 +197,7 @@ public: class SplitLVEdge : public SplitEdge { public: SplitLVEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) - : SplitEdge(graphp, fromp, top, WEIGHT_NORMAL) {} + : SplitEdge{graphp, fromp, top, WEIGHT_NORMAL} {} virtual ~SplitLVEdge() override {} virtual bool followScoreboard() const override { return true; } virtual string dotColor() const override { return "yellowGreen"; } @@ -206,7 +206,7 @@ public: class SplitRVEdge : public SplitEdge { public: SplitRVEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) - : SplitEdge(graphp, fromp, top, WEIGHT_NORMAL) {} + : SplitEdge{graphp, fromp, top, WEIGHT_NORMAL} {} virtual ~SplitRVEdge() override {} virtual bool followScoreboard() const override { return true; } virtual string dotColor() const override { return "green"; } @@ -215,7 +215,7 @@ public: struct SplitScorebdEdge : public SplitEdge { public: SplitScorebdEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) - : SplitEdge(graphp, fromp, top, WEIGHT_NORMAL) {} + : SplitEdge{graphp, fromp, top, WEIGHT_NORMAL} {} virtual ~SplitScorebdEdge() override {} virtual bool followScoreboard() const override { return true; } virtual string dotColor() const override { return "blue"; } @@ -226,7 +226,7 @@ struct SplitStrictEdge : public SplitEdge { // The only non-cutable edge type public: SplitStrictEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) - : SplitEdge(graphp, fromp, top, WEIGHT_NORMAL, NOT_CUTABLE) {} + : SplitEdge{graphp, fromp, top, WEIGHT_NORMAL, NOT_CUTABLE} {} virtual ~SplitStrictEdge() override {} virtual bool followScoreboard() const override { return true; } virtual string dotColor() const override { return "blue"; } @@ -701,9 +701,9 @@ public: // and generates its split blocks, writing the split blocks // into *newBlocksp. EmitSplitVisitor(AstAlways* nodep, const IfColorVisitor* ifColorp, AlwaysVec* newBlocksp) - : m_origAlwaysp(nodep) - , m_ifColorp(ifColorp) - , m_newBlocksp(newBlocksp) { + : m_origAlwaysp{nodep} + , m_ifColorp{ifColorp} + , m_newBlocksp{newBlocksp} { UINFO(6, " splitting always " << nodep << endl); } @@ -830,12 +830,11 @@ private: ReplaceMap m_replaceBlocks; // AstNodeIf* whose condition we're currently visiting - AstNode* m_curIfConditional; + AstNode* m_curIfConditional = nullptr; // CONSTRUCTORS public: - explicit SplitVisitor(AstNetlist* nodep) - : m_curIfConditional(nullptr) { + explicit SplitVisitor(AstNetlist* nodep) { iterate(nodep); // Splice newly-split blocks into the tree. Remove placeholders diff --git a/src/V3SplitAs.cpp b/src/V3SplitAs.cpp index 3f2eb47c0..793638187 100644 --- a/src/V3SplitAs.cpp +++ b/src/V3SplitAs.cpp @@ -45,7 +45,7 @@ public: class SplitAsFindVisitor : public SplitAsBaseVisitor { private: // STATE - AstVarScope* m_splitVscp; // Variable we want to split + AstVarScope* m_splitVscp = nullptr; // Variable we want to split // METHODS virtual void visit(AstVarRef* nodep) override { @@ -57,10 +57,7 @@ private: public: // CONSTRUCTORS - explicit SplitAsFindVisitor(AstAlways* nodep) { - m_splitVscp = nullptr; - iterate(nodep); - } + explicit SplitAsFindVisitor(AstAlways* nodep) { iterate(nodep); } virtual ~SplitAsFindVisitor() override {} // METHODS AstVarScope* splitVscp() const { return m_splitVscp; } @@ -117,8 +114,8 @@ private: public: // CONSTRUCTORS SplitAsCleanVisitor(AstAlways* nodep, AstVarScope* vscp, bool modeMatch) - : m_splitVscp(vscp) - , m_modeMatch(modeMatch) { + : m_splitVscp{vscp} + , m_modeMatch{modeMatch} { iterate(nodep); } virtual ~SplitAsCleanVisitor() override {} @@ -135,7 +132,7 @@ private: // STATE VDouble0 m_statSplits; // Statistic tracking - AstVarScope* m_splitVscp; // Variable we want to split + AstVarScope* m_splitVscp = nullptr; // Variable we want to split // METHODS void splitAlways(AstAlways* nodep) { @@ -187,7 +184,6 @@ private: public: // CONSTRUCTORS explicit SplitAsVisitor(AstNetlist* nodep) { - m_splitVscp = nullptr; AstNode::user1ClearTree(); // user1p() used on entire tree iterate(nodep); } diff --git a/src/V3SplitVar.cpp b/src/V3SplitVar.cpp index 551a89c42..ad9bda871 100644 --- a/src/V3SplitVar.cpp +++ b/src/V3SplitVar.cpp @@ -243,29 +243,29 @@ class UnpackRef { bool m_ftask; // true if the reference is in function/task. false if in module. public: UnpackRef(AstNode* stmtp, AstVarRef* nodep, bool ftask) - : m_contextp(stmtp) - , m_nodep(nodep) - , m_index(-1) - , m_msb(0) - , m_lsb(1) - , m_lvalue(nodep->lvalue()) - , m_ftask(ftask) {} + : m_contextp{stmtp} + , m_nodep{nodep} + , m_index{-1} + , m_msb{0} + , m_lsb{1} + , m_lvalue{nodep->lvalue()} + , m_ftask{ftask} {} UnpackRef(AstNode* stmtp, AstArraySel* nodep, int idx, bool lvalue, bool ftask) - : m_contextp(stmtp) - , m_nodep(nodep) - , m_index(idx) - , m_msb(0) - , m_lsb(1) - , m_lvalue(lvalue) - , m_ftask(ftask) {} + : m_contextp{stmtp} + , m_nodep{nodep} + , m_index{idx} + , m_msb{0} + , m_lsb{1} + , m_lvalue{lvalue} + , m_ftask{ftask} {} UnpackRef(AstNode* stmtp, AstSliceSel* nodep, int msb, int lsb, bool lvalue, bool ftask) - : m_contextp(stmtp) - , m_nodep(nodep) - , m_index(msb == lsb ? msb : -1) // Equivalent to ArraySel - , m_msb(msb) - , m_lsb(lsb) - , m_lvalue(lvalue) - , m_ftask(ftask) {} + : m_contextp{stmtp} + , m_nodep{nodep} + , m_index{msb == lsb ? msb : -1} // Equivalent to ArraySel + , m_msb{msb} + , m_lsb{lsb} + , m_lvalue{lvalue} + , m_ftask{ftask} {} AstNode* nodep() const { return m_nodep; } bool isSingleRef() const { return VN_IS(m_nodep, ArraySel) || (m_msb == m_lsb && m_lsb == m_index); @@ -359,7 +359,7 @@ public: iterateChildren(nodep); } explicit Visitor(RefsInModule& p) - : m_parent(p) {} + : m_parent{p} {} } v(*this); v.iterate(nodep); } @@ -766,7 +766,7 @@ class SplitUnpackedVarVisitor : public AstNVisitor, public SplitVarImpl { public: explicit SplitUnpackedVarVisitor(AstNetlist* nodep) - : m_refs() { + : m_refs{} { iterate(nodep); } ~SplitUnpackedVarVisitor() { @@ -808,9 +808,9 @@ class SplitNewVar { AstVar* m_varp; // The LSB of this variable is always 0, not m_lsb public: SplitNewVar(int lsb, int bitwidth, AstVar* varp = nullptr) - : m_lsb(lsb) - , m_bitwidth(bitwidth) - , m_varp(varp) {} + : m_lsb{lsb} + , m_bitwidth{bitwidth} + , m_varp{varp} {} int lsb() const { return m_lsb; } int msb() const { return m_lsb + m_bitwidth - 1; } int bitwidth() const { return m_bitwidth; } @@ -835,13 +835,13 @@ class PackedVarRefEntry { public: PackedVarRefEntry(AstSel* selp, int lsb, int bitwidth) - : m_nodep(selp) - , m_lsb(lsb) - , m_bitwidth(bitwidth) {} + : m_nodep{selp} + , m_lsb{lsb} + , m_bitwidth{bitwidth} {} PackedVarRefEntry(AstVarRef* refp, int lsb, int bitwidth) - : m_nodep(refp) - , m_lsb(lsb) - , m_bitwidth(bitwidth) {} + : m_nodep{refp} + , m_lsb{lsb} + , m_bitwidth{bitwidth} {} AstNode* nodep() const { return m_nodep; } int lsb() const { return m_lsb; } int msb() const { return m_lsb + m_bitwidth - 1; } @@ -897,7 +897,7 @@ public: return m_rhs; } explicit PackedVarRef(AstVar* varp) - : m_basicp(varp->dtypep()->basicp()) {} + : m_basicp{varp->dtypep()->basicp()} {} void append(const PackedVarRefEntry& e, bool lvalue) { UASSERT(!m_dedupDone, "cannot add after dedup()"); if (lvalue) @@ -1205,9 +1205,9 @@ class SplitPackedVarVisitor : public AstNVisitor, public SplitVarImpl { public: // When reusing the information from SplitUnpackedVarVisitor SplitPackedVarVisitor(AstNetlist* nodep, SplitVarRefsMap& refs) - : m_netp(nodep) - , m_modp(nullptr) - , m_numSplit(0) { + : m_netp{nodep} + , m_modp{nullptr} + , m_numSplit{0} { // If you want ignore refs and walk the tne entire AST, // just call iterateChildren(m_modp) and split() for each module for (SplitVarRefsMap::iterator it = refs.begin(), it_end = refs.end(); it != it_end; diff --git a/src/V3Stats.cpp b/src/V3Stats.cpp index 3e11cf42c..962e3e15e 100644 --- a/src/V3Stats.cpp +++ b/src/V3Stats.cpp @@ -208,8 +208,8 @@ private: public: // CONSTRUCTORS StatsVisitor(AstNetlist* nodep, const string& stage, bool fast) - : m_stage(stage) - , m_fast(fast) { + : m_stage{stage} + , m_fast{fast} { UINFO(9, "Starting stats, fast=" << fast << endl); m_cfuncp = nullptr; m_counting = !m_fast; diff --git a/src/V3Stats.h b/src/V3Stats.h index e43ee539a..ad5985110 100644 --- a/src/V3Stats.h +++ b/src/V3Stats.h @@ -32,12 +32,12 @@ class VDouble0 { public: // METHODS VDouble0() - : m_d(0) {} + : m_d{0.0} {} ~VDouble0() {} // Implicit conversion operators: explicit VDouble0(const vluint64_t v) - : m_d(v) {} + : m_d{static_cast(v)} {} operator double() const { return m_d; } // Explicit operators: @@ -90,12 +90,12 @@ public: // CONSTRUCTORS V3Statistic(const string& stage, const string& name, double count, bool sumit = false, bool perf = false) - : m_name(name) - , m_count(count) - , m_stage(stage) - , m_sumit(sumit) - , m_perf(perf) - , m_printit(true) {} + : m_name{name} + , m_count{count} + , m_stage{stage} + , m_sumit{sumit} + , m_perf{perf} + , m_printit{true} {} virtual ~V3Statistic() {} }; diff --git a/src/V3StatsReport.cpp b/src/V3StatsReport.cpp index 426709535..d16f8df40 100644 --- a/src/V3StatsReport.cpp +++ b/src/V3StatsReport.cpp @@ -182,7 +182,7 @@ public: // CONSTRUCTORS explicit StatsReport(std::ofstream* aofp) - : os(*aofp) { + : os{*aofp} { header(); sumit(); stars(); diff --git a/src/V3String.h b/src/V3String.h index 0c40cc763..95004e57d 100644 --- a/src/V3String.h +++ b/src/V3String.h @@ -127,7 +127,7 @@ public: m_inthash[7] = 0x5be0cd19; } explicit VHashSha256(const string& data) - : VHashSha256() { + : VHashSha256{} { insert(data); } ~VHashSha256() {} @@ -165,7 +165,7 @@ class VName { public: // CONSTRUCTORS explicit VName(const string& name) - : m_name(name) {} + : m_name{name} {} ~VName() {} // METHODS void name(const string& name) { diff --git a/src/V3Subst.cpp b/src/V3Subst.cpp index 86aac57b2..ff857052a 100644 --- a/src/V3Subst.cpp +++ b/src/V3Subst.cpp @@ -67,18 +67,16 @@ protected: class SubstVarEntry { // MEMBERS AstVar* m_varp; // Variable this tracks - bool m_wordAssign; // True if any word assignments - bool m_wordUse; // True if any individual word usage + bool m_wordAssign = false; // True if any word assignments + bool m_wordUse = false; // True if any individual word usage SubstVarWord m_whole; // Data for whole vector used at once std::vector m_words; // Data for every word, if multi word variable int debug() { return SubstBaseVisitor::debug(); } public: // CONSTRUCTORS - explicit SubstVarEntry(AstVar* varp) { // Construction for when a var is used - m_varp = varp; - m_wordAssign = false; - m_wordUse = false; + explicit SubstVarEntry(AstVar* varp) + : m_varp{varp} { // Construction for when a var is used m_words.resize(varp->widthWords()); m_whole.clear(); for (int i = 0; i < varp->widthWords(); i++) m_words[i].clear(); @@ -211,7 +209,7 @@ private: public: // CONSTRUCTORS SubstUseVisitor(AstNode* nodep, int origStep) - : m_origStep(origStep) { + : m_origStep{origStep} { UINFO(9, " SubstUseVisitor " << origStep << " " << nodep << endl); iterate(nodep); } @@ -234,8 +232,8 @@ private: // STATE std::vector m_entryps; // Nodes to delete when we are finished - int m_ops; // Number of operators on assign rhs - int m_assignStep; // Assignment number to determine var lifetime + int m_ops = 0; // Number of operators on assign rhs + int m_assignStep = 0; // Assignment number to determine var lifetime VDouble0 m_statSubsts; // Statistic tracking enum { @@ -370,8 +368,6 @@ public: explicit SubstVisitor(AstNode* nodep) { AstNode::user1ClearTree(); // user1p() used on entire tree AstNode::user2ClearTree(); // user2p() used on entire tree - m_ops = 0; - m_assignStep = 0; iterate(nodep); } virtual ~SubstVisitor() override { diff --git a/src/V3TSP.cpp b/src/V3TSP.cpp index 8daf4c64e..4cc49c3f9 100644 --- a/src/V3TSP.cpp +++ b/src/V3TSP.cpp @@ -57,8 +57,8 @@ private: public: TspVertexTmpl(V3Graph* graphp, const T_Key& k) - : V3GraphVertex(graphp) - , m_key(k) {} + : V3GraphVertex{graphp} + , m_key{k} {} virtual ~TspVertexTmpl() override {} const T_Key& key() const { return m_key; } @@ -79,7 +79,7 @@ public: // CONSTRUCTORS TspGraphTmpl() - : V3Graph() {} + : V3Graph{} {} virtual ~TspGraphTmpl() override {} // METHODS @@ -503,9 +503,9 @@ void V3TSP::tspSort(const V3TSP::StateVec& states, V3TSP::StateVec* resultp) { class TspTestState : public V3TSP::TspStateBase { public: TspTestState(unsigned xpos, unsigned ypos) - : m_xpos(xpos) - , m_ypos(ypos) - , m_serial(++m_serialNext) {} + : m_xpos{xpos} + , m_ypos{ypos} + , m_serial{++m_serialNext} {} ~TspTestState() {} virtual int cost(const TspStateBase* otherp) const override { return cost(dynamic_cast(otherp)); diff --git a/src/V3Table.cpp b/src/V3Table.cpp index 5c5f420da..629542549 100644 --- a/src/V3Table.cpp +++ b/src/V3Table.cpp @@ -57,7 +57,8 @@ public: virtual void varRefCb(AstVarRef* nodep) override; // CONSTRUCTORS - explicit TableSimulateVisitor(TableVisitor* cbthis) { m_cbthis = cbthis; } + explicit TableSimulateVisitor(TableVisitor* cbthis) + : m_cbthis{cbthis} {} virtual ~TableSimulateVisitor() override {} }; @@ -70,22 +71,22 @@ private: // Cleared on each always/assignw // STATE - double m_totalBytes; // Total bytes in tables created + double m_totalBytes = 0; // Total bytes in tables created VDouble0 m_statTablesCre; // Statistic tracking // State cleared on each module - AstNodeModule* m_modp; // Current MODULE - int m_modTables; // Number of tables created in this module + AstNodeModule* m_modp = nullptr; // Current MODULE + int m_modTables = 0; // Number of tables created in this module typedef std::deque ModTableVector; ModTableVector m_modTableVscs; // All tables created // State cleared on each scope - AstScope* m_scopep; // Current SCOPE + AstScope* m_scopep = nullptr; // Current SCOPE // State cleared on each always/assignw - bool m_assignDly; // Consists of delayed assignments instead of normal assignments - int m_inWidth; // Input table width - int m_outWidth; // Output table width + bool m_assignDly = false; // Consists of delayed assignments instead of normal assignments + int m_inWidth = 0; // Input table width + int m_outWidth = 0; // Output table width std::deque m_inVarps; // Input variable list std::deque m_outVarps; // Output variable list std::deque m_outNotSet; // True if output variable is not set at some point @@ -451,16 +452,7 @@ private: public: // CONSTRUCTORS - explicit TableVisitor(AstNetlist* nodep) { - m_modp = nullptr; - m_modTables = 0; - m_scopep = nullptr; - m_assignDly = 0; - m_inWidth = 0; - m_outWidth = 0; - m_totalBytes = 0; - iterate(nodep); - } + explicit TableVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~TableVisitor() override { // V3Stats::addStat("Optimizations, Tables created", m_statTablesCre); } diff --git a/src/V3Task.cpp b/src/V3Task.cpp index 78ef2688b..b34dd4ed3 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -44,7 +44,7 @@ class TaskBaseVertex : public V3GraphVertex { bool m_noInline = false; // Marked with pragma public: explicit TaskBaseVertex(V3Graph* graphp) - : V3GraphVertex(graphp) {} + : V3GraphVertex{graphp} {} virtual ~TaskBaseVertex() override {} bool pure() const { return m_impurep == nullptr; } AstNode* impureNode() const { return m_impurep; } @@ -56,14 +56,12 @@ public: class TaskFTaskVertex : public TaskBaseVertex { // Every task gets a vertex, and we link tasks together based on funcrefs. AstNodeFTask* m_nodep; - AstCFunc* m_cFuncp; + AstCFunc* m_cFuncp = nullptr; public: TaskFTaskVertex(V3Graph* graphp, AstNodeFTask* nodep) - : TaskBaseVertex(graphp) - , m_nodep(nodep) { - m_cFuncp = nullptr; - } + : TaskBaseVertex{graphp} + , m_nodep{nodep} {} virtual ~TaskFTaskVertex() override {} AstNodeFTask* nodep() const { return m_nodep; } virtual string name() const override { return nodep()->name(); } @@ -77,7 +75,7 @@ class TaskCodeVertex : public TaskBaseVertex { // Top vertex for all calls not under another task public: explicit TaskCodeVertex(V3Graph* graphp) - : TaskBaseVertex(graphp) {} + : TaskBaseVertex{graphp} {} virtual ~TaskCodeVertex() override {} virtual string name() const override { return "*CODE*"; } virtual string dotColor() const override { return "green"; } @@ -86,7 +84,7 @@ public: class TaskEdge : public V3GraphEdge { public: TaskEdge(V3Graph* graphp, TaskBaseVertex* fromp, TaskBaseVertex* top) - : V3GraphEdge(graphp, fromp, top, 1, false) {} + : V3GraphEdge{graphp, fromp, top, 1, false} {} virtual ~TaskEdge() override {} virtual string dotLabel() const override { return "w" + cvtToStr(weight()); } }; @@ -333,12 +331,12 @@ private: // STATE TaskStateVisitor* m_statep; // Common state between visitors - AstNodeModule* m_modp; // Current module - AstTopScope* m_topScopep; // Current top scope - AstScope* m_scopep; // Current scope - InsertMode m_insMode; // How to insert - AstNode* m_insStmtp; // Where to insert statement - int m_modNCalls; // Incrementing func # for making symbols + AstNodeModule* m_modp = nullptr; // Current module + AstTopScope* m_topScopep = nullptr; // Current top scope + AstScope* m_scopep = nullptr; // Current scope + InsertMode m_insMode = IM_BEFORE; // How to insert + AstNode* m_insStmtp = nullptr; // Where to insert statement + int m_modNCalls = 0; // Incrementing func # for making symbols DpiNames m_dpiNames; // Map of all created DPI functions // METHODS @@ -1353,13 +1351,7 @@ private: public: // CONSTRUCTORS TaskVisitor(AstNetlist* nodep, TaskStateVisitor* statep) - : m_statep(statep) { - m_modp = nullptr; - m_topScopep = nullptr; - m_scopep = nullptr; - m_insMode = IM_BEFORE; - m_insStmtp = nullptr; - m_modNCalls = 0; + : m_statep{statep} { AstNode::user1ClearTree(); iterate(nodep); } diff --git a/src/V3Trace.cpp b/src/V3Trace.cpp index 0b2e96985..db9f3ebc6 100644 --- a/src/V3Trace.cpp +++ b/src/V3Trace.cpp @@ -60,14 +60,14 @@ public: enum { ACTIVITY_ALWAYS = ((1UL << 31) - 2) }; enum { ACTIVITY_SLOW = 0 }; TraceActivityVertex(V3Graph* graphp, AstNode* nodep, bool slow) - : V3GraphVertex(graphp) - , m_insertp(nodep) { + : V3GraphVertex{graphp} + , m_insertp{nodep} { m_activityCode = 0; m_slow = slow; } TraceActivityVertex(V3Graph* graphp, vlsint32_t code) - : V3GraphVertex(graphp) - , m_insertp(nullptr) { + : V3GraphVertex{graphp} + , m_insertp{nullptr} { m_activityCode = code; m_slow = false; } @@ -100,8 +100,8 @@ class TraceCFuncVertex : public V3GraphVertex { public: TraceCFuncVertex(V3Graph* graphp, AstCFunc* nodep) - : V3GraphVertex(graphp) - , m_nodep(nodep) {} + : V3GraphVertex{graphp} + , m_nodep{nodep} {} virtual ~TraceCFuncVertex() override {} // ACCESSORS AstCFunc* nodep() const { return m_nodep; } @@ -113,13 +113,12 @@ public: class TraceTraceVertex : public V3GraphVertex { AstTraceDecl* const m_nodep; // TRACEINC this represents // nullptr, or other vertex with the real code() that duplicates this one - TraceTraceVertex* m_duplicatep; + TraceTraceVertex* m_duplicatep = nullptr; public: TraceTraceVertex(V3Graph* graphp, AstTraceDecl* nodep) - : V3GraphVertex(graphp) - , m_nodep(nodep) - , m_duplicatep(nullptr) {} + : V3GraphVertex{graphp} + , m_nodep{nodep} {} virtual ~TraceTraceVertex() override {} // ACCESSORS AstTraceDecl* nodep() const { return m_nodep; } @@ -138,8 +137,8 @@ class TraceVarVertex : public V3GraphVertex { public: TraceVarVertex(V3Graph* graphp, AstVarScope* nodep) - : V3GraphVertex(graphp) - , m_nodep(nodep) {} + : V3GraphVertex{graphp} + , m_nodep{nodep} {} virtual ~TraceVarVertex() override {} // ACCESSORS AstVarScope* nodep() const { return m_nodep; } @@ -168,16 +167,16 @@ private: // AstUser4InUse In V3Hashed // STATE - AstNodeModule* m_topModp; // Module to add variables to - AstScope* m_topScopep; // Scope to add variables to - AstCFunc* m_funcp; // C function adding to graph - AstTraceDecl* m_tracep; // Trace function adding to graph - AstVarScope* m_activityVscp; // Activity variable - uint32_t m_activityNumber; // Count of fields in activity variable - uint32_t m_code; // Trace ident code# being assigned + AstNodeModule* m_topModp = nullptr; // Module to add variables to + AstScope* m_topScopep = nullptr; // Scope to add variables to + AstCFunc* m_funcp = nullptr; // C function adding to graph + AstTraceDecl* m_tracep = nullptr; // Trace function adding to graph + AstVarScope* m_activityVscp = nullptr; // Activity variable + uint32_t m_activityNumber = 0; // Count of fields in activity variable + uint32_t m_code = 0; // Trace ident code# being assigned V3Graph m_graph; // Var/CFunc tracking TraceActivityVertex* const m_alwaysVtxp; // "Always trace" vertex - bool m_finding; // Pass one of algorithm? + bool m_finding = false; // Pass one of algorithm? VDouble0 m_statChgSigs; // Statistic tracking VDouble0 m_statUniqSigs; // Statistic tracking @@ -874,15 +873,7 @@ private: public: // CONSTRUCTORS explicit TraceVisitor(AstNetlist* nodep) - : m_alwaysVtxp(new TraceActivityVertex(&m_graph, TraceActivityVertex::ACTIVITY_ALWAYS)) { - m_funcp = nullptr; - m_tracep = nullptr; - m_topModp = nullptr; - m_topScopep = nullptr; - m_finding = false; - m_activityVscp = nullptr; - m_activityNumber = 0; - m_code = 0; + : m_alwaysVtxp{new TraceActivityVertex{&m_graph, TraceActivityVertex::ACTIVITY_ALWAYS}} { iterate(nodep); } virtual ~TraceVisitor() override { diff --git a/src/V3TraceDecl.cpp b/src/V3TraceDecl.cpp index 825679946..8d28ceede 100644 --- a/src/V3TraceDecl.cpp +++ b/src/V3TraceDecl.cpp @@ -36,15 +36,15 @@ private: // NODE STATE // STATE - AstScope* m_topScopep; // Current top scope - AstCFunc* m_initFuncp; // Trace function being built - AstCFunc* m_initSubFuncp; // Trace function being built (under m_init) - int m_initSubStmts; // Number of statements in function - int m_funcNum; // Function number being built - AstVarScope* m_traVscp; // Signal being trace constructed - AstNode* m_traValuep; // Signal being traced's value to trace in it + AstScope* m_topScopep = nullptr; // Current top scope + AstCFunc* m_initFuncp = nullptr; // Trace function being built + AstCFunc* m_initSubFuncp = nullptr; // Trace function being built (under m_init) + int m_initSubStmts = 0; // Number of statements in function + int m_funcNum = 0; // Function number being built + AstVarScope* m_traVscp = nullptr; // Signal being trace constructed + AstNode* m_traValuep = nullptr; // Signal being traced's value to trace in it string m_traShowname; // Signal being traced's component name - bool m_interface; // Currently tracing an interface + bool m_interface = false; // Currently tracing an interface VDouble0 m_statSigs; // Statistic tracking VDouble0 m_statIgnSigs; // Statistic tracking @@ -338,17 +338,7 @@ private: public: // CONSTRUCTORS - explicit TraceDeclVisitor(AstNetlist* nodep) { - m_topScopep = nullptr; - m_initFuncp = nullptr; - m_initSubFuncp = nullptr; - m_initSubStmts = 0; - m_funcNum = 0; - m_traVscp = nullptr; - m_traValuep = nullptr; - m_interface = false; - iterate(nodep); - } + explicit TraceDeclVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~TraceDeclVisitor() override { V3Stats::addStat("Tracing, Traced signals", m_statSigs); V3Stats::addStat("Tracing, Ignored signals", m_statIgnSigs); diff --git a/src/V3Tristate.cpp b/src/V3Tristate.cpp index ed61c40f9..7b16dcb19 100644 --- a/src/V3Tristate.cpp +++ b/src/V3Tristate.cpp @@ -85,8 +85,8 @@ class TristateVertex : public V3GraphVertex { bool m_processed = false; // Tristating was cleaned up public: TristateVertex(V3Graph* graphp, AstNode* nodep) - : V3GraphVertex(graphp) - , m_nodep(nodep) {} + : V3GraphVertex{graphp} + , m_nodep{nodep} {} virtual ~TristateVertex() override {} // ACCESSORS AstNode* nodep() const { return m_nodep; } @@ -302,8 +302,8 @@ class TristatePinVisitor : public TristateBaseVisitor { public: // CONSTRUCTORS TristatePinVisitor(AstNode* nodep, TristateGraph& tgraph, bool lvalue) - : m_tgraph(tgraph) - , m_lvalue(lvalue) { + : m_tgraph{tgraph} + , m_lvalue{lvalue} { iterate(nodep); } virtual ~TristatePinVisitor() override {} @@ -336,14 +336,14 @@ class TristateVisitor : public TristateBaseVisitor { }; // Both bits set // MEMBERS - bool m_graphing; // Major mode - creating graph + bool m_graphing = false; // Major mode - creating graph // - AstNodeModule* m_modp; // Current module - AstCell* m_cellp; // current cell + AstNodeModule* m_modp = nullptr; // Current module + AstCell* m_cellp = nullptr; // current cell VarMap m_lhsmap; // LHS driver map - int m_unique; - bool m_alhs; // On LHS of assignment - AstNode* m_logicp; // Current logic being built + int m_unique = 0; + bool m_alhs = false; // On LHS of assignment + AstNode* m_logicp = nullptr; // Current logic being built TristateGraph m_tgraph; // Logic graph // STATS @@ -1345,12 +1345,6 @@ class TristateVisitor : public TristateBaseVisitor { public: // CONSTRUCTORS explicit TristateVisitor(AstNode* nodep) { - m_graphing = false; - m_modp = nullptr; - m_cellp = nullptr; - m_unique = 0; - m_alhs = false; - m_logicp = nullptr; m_tgraph.clear(); iterate(nodep); } diff --git a/src/V3Undriven.cpp b/src/V3Undriven.cpp index c76d0cb32..165801528 100644 --- a/src/V3Undriven.cpp +++ b/src/V3Undriven.cpp @@ -238,11 +238,11 @@ private: // STATE std::vector m_entryps[3]; // Nodes to delete when we are finished - bool m_inBBox; // In black box; mark as driven+used - bool m_inContAssign; // In continuous assignment - bool m_inProcAssign; // In procedural assignment - AstNodeFTask* m_taskp; // Current task - AstAlways* m_alwaysCombp; // Current always if combo, otherwise nullptr + bool m_inBBox = false; // In black box; mark as driven+used + bool m_inContAssign = false; // In continuous assignment + bool m_inProcAssign = false; // In procedural assignment + AstNodeFTask* m_taskp = nullptr; // Current task + AstAlways* m_alwaysCombp = nullptr; // Current always if combo, otherwise nullptr // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -439,14 +439,7 @@ private: public: // CONSTRUCTORS - explicit UndrivenVisitor(AstNetlist* nodep) { - m_inBBox = false; - m_inContAssign = false; - m_inProcAssign = false; - m_taskp = nullptr; - m_alwaysCombp = nullptr; - iterate(nodep); - } + explicit UndrivenVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~UndrivenVisitor() override { for (std::vector::iterator it = m_entryps[1].begin(); it != m_entryps[1].end(); ++it) { diff --git a/src/V3Unknown.cpp b/src/V3Unknown.cpp index e7eb7f282..c1c7d6c22 100644 --- a/src/V3Unknown.cpp +++ b/src/V3Unknown.cpp @@ -52,11 +52,11 @@ private: AstUser2InUse m_inuser2; // STATE - AstNodeModule* m_modp; // Current module - bool m_constXCvt; // Convert X's + AstNodeModule* m_modp = nullptr; // Current module + AstAssignW* m_assignwp = nullptr; // Current assignment + AstAssignDly* m_assigndlyp = nullptr; // Current assignment + bool m_constXCvt = false; // Convert X's VDouble0 m_statUnkVars; // Statistic tracking - AstAssignW* m_assignwp; // Current assignment - AstAssignDly* m_assigndlyp; // Current assignment // METHODS VL_DEBUG_FUNC; // Declare debug() @@ -428,13 +428,7 @@ private: public: // CONSTRUCTORS - explicit UnknownVisitor(AstNetlist* nodep) { - m_modp = nullptr; - m_assigndlyp = nullptr; - m_assignwp = nullptr; - m_constXCvt = false; - iterate(nodep); - } + explicit UnknownVisitor(AstNetlist* nodep) { iterate(nodep); } virtual ~UnknownVisitor() override { // V3Stats::addStat("Unknowns, variables created", m_statUnkVars); } diff --git a/src/V3Unroll.cpp b/src/V3Unroll.cpp index d3146445a..c44e4520b 100644 --- a/src/V3Unroll.cpp +++ b/src/V3Unroll.cpp @@ -497,7 +497,7 @@ public: // Unroll class functions UnrollStateful::UnrollStateful() - : m_unrollerp(new UnrollVisitor) {} + : m_unrollerp{new UnrollVisitor} {} UnrollStateful::~UnrollStateful() { delete m_unrollerp; } void UnrollStateful::unrollGen(AstNodeFor* nodep, const string& beginName) { diff --git a/src/V3Width.cpp b/src/V3Width.cpp index ee508070f..8522e91ca 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -105,14 +105,14 @@ class WidthVP { Stage m_stage; // If true, report errors public: WidthVP(AstNodeDType* dtypep, Stage stage) - : m_dtypep(dtypep) - , m_stage(stage) { + : m_dtypep{dtypep} + , m_stage{stage} { // Prelim doesn't look at assignments, so shouldn't need a dtype, // however AstPattern uses them } WidthVP(Determ determ, Stage stage) - : m_dtypep(nullptr) - , m_stage(stage) { + : m_dtypep{nullptr} + , m_stage{stage} { if (determ != SELF && stage != PRELIM) v3fatalSrc("Context-determined width request only allowed as prelim step"); } @@ -184,15 +184,16 @@ private: typedef std::map PatVecMap; // STATE - WidthVP* m_vup; // Current node state + WidthVP* m_vup = nullptr; // Current node state bool m_paramsOnly; // Computing parameter value; limit operation - AstRange* m_cellRangep; // Range for arrayed instantiations, nullptr for normal instantiations - AstNodeFTask* m_ftaskp; // Current function/task - AstNodeProcedure* m_procedurep; // Current final/always - AstFunc* m_funcp; // Current function - AstAttrOf* m_attrp; // Current attribute + AstRange* m_cellRangep + = nullptr; // Range for arrayed instantiations, nullptr for normal instantiations + AstNodeFTask* m_ftaskp = nullptr; // Current function/task + AstNodeProcedure* m_procedurep = nullptr; // Current final/always + AstFunc* m_funcp = nullptr; // Current function + AstAttrOf* m_attrp = nullptr; // Current attribute bool m_doGenerate; // Do errors later inside generate statement - int m_dtTables; // Number of created data type tables + int m_dtTables = 0; // Number of created data type tables TableMap m_tableMap; // Created tables so can remove duplicates // ENUMS @@ -5404,18 +5405,10 @@ private: public: // CONSTRUCTORS WidthVisitor(bool paramsOnly, // [in] TRUE if we are considering parameters only. - bool doGenerate) { // [in] TRUE if we are inside a generate statement and + bool doGenerate) // [in] TRUE if we are inside a generate statement and // // don't wish to trigger errors - m_paramsOnly = paramsOnly; - m_cellRangep = nullptr; - m_ftaskp = nullptr; - m_procedurep = nullptr; - m_funcp = nullptr; - m_attrp = nullptr; - m_doGenerate = doGenerate; - m_dtTables = 0; - m_vup = nullptr; - } + : m_paramsOnly{paramsOnly} + , m_doGenerate{doGenerate} {} AstNode* mainAcceptEdit(AstNode* nodep) { return userIterateSubtreeReturnEdits(nodep, WidthVP(SELF, BOTH).p()); } diff --git a/src/V3WidthSel.cpp b/src/V3WidthSel.cpp index fc5ac583a..0854675e9 100644 --- a/src/V3WidthSel.cpp +++ b/src/V3WidthSel.cpp @@ -64,9 +64,9 @@ private: AstNodeDType* m_dtypep; // Data type for the 'from' slice VNumRange m_fromRange; // Numeric range bounds for the 'from' slice FromData(AstNodeDType* errp, AstNodeDType* dtypep, const VNumRange& fromRange) - : m_errp(errp) - , m_dtypep(dtypep) - , m_fromRange(fromRange) {} + : m_errp{errp} + , m_dtypep{dtypep} + , m_fromRange{fromRange} {} ~FromData() {} }; FromData fromDataForArray(AstNode* nodep, AstNode* basefromp) { diff --git a/src/VlcPoint.h b/src/VlcPoint.h index 426aa2dd4..2b37c58e6 100644 --- a/src/VlcPoint.h +++ b/src/VlcPoint.h @@ -39,9 +39,9 @@ private: public: // CONSTRUCTORS - VlcPoint(const string& name, int pointNum) - : m_name(name) - , m_pointNum(pointNum) {} + VlcPoint(const string& name, vluint64_t pointNum) + : m_name{name} + , m_pointNum{pointNum} {} ~VlcPoint() {} // ACCESSORS const string& name() const { return m_name; } diff --git a/src/VlcSource.h b/src/VlcSource.h index 68b3deca0..4f8e90e19 100644 --- a/src/VlcSource.h +++ b/src/VlcSource.h @@ -37,8 +37,8 @@ private: public: // CONSTRUCTORS VlcSourceCount(int lineno, int column) - : m_lineno(lineno) - , m_column(column) {} + : m_lineno{lineno} + , m_column{column} {} ~VlcSourceCount() {} // ACCESSORS @@ -66,15 +66,13 @@ public: private: // MEMBERS string m_name; //< Name of the source file - bool m_needed; //< Need to annotate; has low coverage + bool m_needed = false; //< Need to annotate; has low coverage LinenoMap m_lines; //< Map of each annotated line public: // CONSTRUCTORS - explicit VlcSource(const string& name) { - m_name = name; - m_needed = false; - } + explicit VlcSource(const string& name) + : m_name{name} {} ~VlcSource() {} // ACCESSORS diff --git a/src/VlcTest.h b/src/VlcTest.h index 423699734..f95bd4de6 100644 --- a/src/VlcTest.h +++ b/src/VlcTest.h @@ -43,9 +43,9 @@ private: public: // CONSTRUCTORS VlcTest(const string& name, vluint64_t testrun, double comp) - : m_name(name) - , m_computrons(comp) - , m_testrun(testrun) {} + : m_name{name} + , m_computrons{comp} + , m_testrun{testrun} {} ~VlcTest() {} // ACCESSORS diff --git a/src/verilog.y b/src/verilog.y index c030ca40e..2f16ef23f 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -50,46 +50,32 @@ class V3ParseGrammar { public: - bool m_impliedDecl; // Allow implied wire declarations + bool m_impliedDecl = false; // Allow implied wire declarations AstVarType m_varDecl; // Type for next signal declaration (reg/wire/etc) - bool m_varDeclTyped; // Var got reg/wire for dedup check + bool m_varDeclTyped = false; // Var got reg/wire for dedup check VDirection m_varIO; // Direction for next signal declaration (reg/wire/etc) VLifetime m_varLifetime; // Static/Automatic for next signal - AstVar* m_varAttrp; // Current variable for attribute adding - AstRange* m_gateRangep; // Current range for gate declarations - AstCase* m_caseAttrp; // Current case statement for attribute adding - AstNodeDType* m_varDTypep; // Pointer to data type for next signal declaration - AstNodeDType* m_memDTypep; // Pointer to data type for next member declaration - AstNodeModule* m_modp; // Last module for timeunits - bool m_pinAnsi; // In ANSI port list - FileLine* m_instModuleFl; // Fileline of module referenced for instantiations + AstVar* m_varAttrp = nullptr; // Current variable for attribute adding + AstRange* m_gateRangep = nullptr; // Current range for gate declarations + AstCase* m_caseAttrp = nullptr; // Current case statement for attribute adding + AstNodeDType* m_varDTypep = nullptr; // Pointer to data type for next signal declaration + AstNodeDType* m_memDTypep = nullptr; // Pointer to data type for next member declaration + AstNodeModule* m_modp = nullptr; // Last module for timeunits + bool m_pinAnsi = false; // In ANSI port list + FileLine* m_instModuleFl = nullptr; // Fileline of module referenced for instantiations string m_instModule; // Name of module referenced for instantiations - AstPin* m_instParamp; // Parameters for instantiations - bool m_tracingParse; // Tracing disable for parser + AstPin* m_instParamp = nullptr; // Parameters for instantiations + bool m_tracingParse = true; // Tracing disable for parser - int m_pinNum; // Pin number currently parsing + int m_pinNum = -1; // Pin number currently parsing std::stack m_pinStack; // Queue of pin numbers being parsed static int s_modTypeImpNum; // Implicit type number, incremented each module // CONSTRUCTORS V3ParseGrammar() { - m_impliedDecl = false; m_varDecl = AstVarType::UNKNOWN; - m_varDeclTyped = false; m_varIO = VDirection::NONE; - m_varDTypep = nullptr; - m_gateRangep = nullptr; - m_memDTypep = nullptr; - m_modp = nullptr; - m_pinAnsi = false; - m_pinNum = -1; - m_instModuleFl = nullptr; - m_instModule = ""; - m_instParamp = nullptr; - m_varAttrp = nullptr; - m_caseAttrp = nullptr; - m_tracingParse = true; } static V3ParseGrammar* singletonp() { static V3ParseGrammar singleton;