C++11: Use member declaration initalizations (in nodes). No functional change intended.

This commit is contained in:
Wilson Snyder 2020-08-16 11:40:42 -04:00
parent 72d2cff0a1
commit 034737d2a8
8 changed files with 326 additions and 346 deletions

View File

@ -82,9 +82,9 @@ public:
inline AstType() {} inline AstType() {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline AstType(en _e) inline AstType(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline AstType(int _e) explicit inline AstType(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
}; };
inline bool operator==(const AstType& lhs, const AstType& rhs) { return lhs.m_e == rhs.m_e; } inline bool operator==(const AstType& lhs, const AstType& rhs) { return lhs.m_e == rhs.m_e; }
@ -103,12 +103,12 @@ public:
return names[m_e]; return names[m_e];
} }
inline VLifetime() inline VLifetime()
: m_e(NONE) {} : m_e{NONE} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VLifetime(en _e) inline VLifetime(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VLifetime(int _e) explicit inline VLifetime(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
bool isNone() const { return m_e == NONE; } bool isNone() const { return m_e == NONE; }
bool isAutomatic() const { return m_e == AUTOMATIC; } bool isAutomatic() const { return m_e == AUTOMATIC; }
@ -137,15 +137,15 @@ public:
return names[m_e]; return names[m_e];
} }
inline VSigning() inline VSigning()
: m_e(UNSIGNED) {} : m_e{UNSIGNED} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VSigning(en _e) inline VSigning(en _e)
: m_e(_e) {} : m_e{_e} {}
static inline VSigning fromBool(bool isSigned) { // Factory method static inline VSigning fromBool(bool isSigned) { // Factory method
return isSigned ? VSigning(SIGNED) : VSigning(UNSIGNED); return isSigned ? VSigning(SIGNED) : VSigning(UNSIGNED);
} }
explicit inline VSigning(int _e) explicit inline VSigning(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
inline bool isSigned() const { return m_e == SIGNED; } inline bool isSigned() const { return m_e == SIGNED; }
inline bool isNosign() const { return m_e == NOSIGN; } inline bool isNosign() const { return m_e == NOSIGN; }
@ -177,12 +177,12 @@ public:
}; };
enum en m_e; enum en m_e;
inline AstPragmaType() inline AstPragmaType()
: m_e(ILLEGAL) {} : m_e{ILLEGAL} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline AstPragmaType(en _e) inline AstPragmaType(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline AstPragmaType(int _e) explicit inline AstPragmaType(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
}; };
inline bool operator==(const AstPragmaType& lhs, const AstPragmaType& rhs) { inline bool operator==(const AstPragmaType& lhs, const AstPragmaType& rhs) {
@ -208,12 +208,12 @@ public:
}; };
enum en m_e; enum en m_e;
inline AstCFuncType() inline AstCFuncType()
: m_e(FT_NORMAL) {} : m_e{FT_NORMAL} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline AstCFuncType(en _e) inline AstCFuncType(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline AstCFuncType(int _e) explicit inline AstCFuncType(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
// METHODS // METHODS
bool isTrace() const { return m_e != FT_NORMAL; } bool isTrace() const { return m_e != FT_NORMAL; }
@ -298,12 +298,12 @@ public:
return false; return false;
} }
inline VEdgeType() inline VEdgeType()
: m_e(ET_ILLEGAL) {} : m_e{ET_ILLEGAL} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VEdgeType(en _e) inline VEdgeType(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VEdgeType(int _e) explicit inline VEdgeType(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
}; };
inline bool operator==(const VEdgeType& lhs, const VEdgeType& rhs) { return lhs.m_e == rhs.m_e; } inline bool operator==(const VEdgeType& lhs, const VEdgeType& rhs) { return lhs.m_e == rhs.m_e; }
@ -378,12 +378,12 @@ public:
return names[m_e]; return names[m_e];
} }
inline AstAttrType() inline AstAttrType()
: m_e(ILLEGAL) {} : m_e{ILLEGAL} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline AstAttrType(en _e) inline AstAttrType(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline AstAttrType(int _e) explicit inline AstAttrType(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
}; };
inline bool operator==(const AstAttrType& lhs, const AstAttrType& rhs) { inline bool operator==(const AstAttrType& lhs, const AstAttrType& rhs) {
@ -448,12 +448,12 @@ public:
"SelfTest: Enum mismatch"); "SelfTest: Enum mismatch");
} }
inline AstBasicDTypeKwd() inline AstBasicDTypeKwd()
: m_e(UNKNOWN) {} : m_e{UNKNOWN} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline AstBasicDTypeKwd(en _e) inline AstBasicDTypeKwd(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline AstBasicDTypeKwd(int _e) explicit inline AstBasicDTypeKwd(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
int width() const { int width() const {
switch (m_e) { switch (m_e) {
@ -535,12 +535,12 @@ public:
enum en { NONE, INPUT, OUTPUT, INOUT, REF, CONSTREF }; enum en { NONE, INPUT, OUTPUT, INOUT, REF, CONSTREF };
enum en m_e; enum en m_e;
inline VDirection() inline VDirection()
: m_e(NONE) {} : m_e{NONE} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VDirection(en _e) inline VDirection(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VDirection(int _e) explicit inline VDirection(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
const char* ascii() const { const char* ascii() const {
static const char* const names[] = {"NONE", "INPUT", "OUTPUT", "INOUT", "REF", "CONSTREF"}; static const char* const names[] = {"NONE", "INPUT", "OUTPUT", "INOUT", "REF", "CONSTREF"};
@ -581,12 +581,12 @@ public:
enum en m_e; enum en m_e;
// CONSTRUCTOR - note defaults to *UNKNOWN* // CONSTRUCTOR - note defaults to *UNKNOWN*
inline VBoolOrUnknown() inline VBoolOrUnknown()
: m_e(BU_UNKNOWN) {} : m_e{BU_UNKNOWN} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VBoolOrUnknown(en _e) inline VBoolOrUnknown(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VBoolOrUnknown(int _e) explicit inline VBoolOrUnknown(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
const char* ascii() const { const char* ascii() const {
static const char* const names[] = {"FALSE", "TRUE", "UNK"}; static const char* const names[] = {"FALSE", "TRUE", "UNK"};
return names[m_e]; return names[m_e];
@ -620,12 +620,12 @@ public:
enum en m_e; enum en m_e;
// CONSTRUCTOR - note defaults to *UNKNOWN* // CONSTRUCTOR - note defaults to *UNKNOWN*
inline VJoinType() inline VJoinType()
: m_e(JOIN) {} : m_e{JOIN} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VJoinType(en _e) inline VJoinType(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VJoinType(int _e) explicit inline VJoinType(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
const char* ascii() const { const char* ascii() const {
static const char* const names[] = {"JOIN", "JOIN_ANY", "JOIN_NONE"}; static const char* const names[] = {"JOIN", "JOIN_ANY", "JOIN_NONE"};
return names[m_e]; return names[m_e];
@ -673,12 +673,12 @@ public:
}; };
enum en m_e; enum en m_e;
inline AstVarType() inline AstVarType()
: m_e(UNKNOWN) {} : m_e{UNKNOWN} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline AstVarType(en _e) inline AstVarType(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline AstVarType(int _e) explicit inline AstVarType(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
const char* ascii() const { const char* ascii() const {
static const char* const names[] = { static const char* const names[] = {
@ -721,12 +721,12 @@ public:
enum en m_e; enum en m_e;
// CONSTRUCTOR - note defaults to *UNKNOWN* // CONSTRUCTOR - note defaults to *UNKNOWN*
inline VBranchPred() inline VBranchPred()
: m_e(BP_UNKNOWN) {} : m_e{BP_UNKNOWN} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VBranchPred(en _e) inline VBranchPred(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VBranchPred(int _e) explicit inline VBranchPred(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
bool unknown() const { return m_e == BP_UNKNOWN; } bool unknown() const { return m_e == BP_UNKNOWN; }
bool likely() const { return m_e == BP_LIKELY; } bool likely() const { return m_e == BP_LIKELY; }
@ -762,12 +762,12 @@ public:
enum en m_e; enum en m_e;
// CONSTRUCTOR - note defaults to *UNKNOWN* // CONSTRUCTOR - note defaults to *UNKNOWN*
inline VVarAttrClocker() inline VVarAttrClocker()
: m_e(CLOCKER_UNKNOWN) {} : m_e{CLOCKER_UNKNOWN} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VVarAttrClocker(en _e) inline VVarAttrClocker(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VVarAttrClocker(int _e) explicit inline VVarAttrClocker(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
bool unknown() const { return m_e == CLOCKER_UNKNOWN; } bool unknown() const { return m_e == CLOCKER_UNKNOWN; }
VVarAttrClocker invert() const { VVarAttrClocker invert() const {
@ -804,12 +804,12 @@ public:
enum en { ALWAYS, ALWAYS_FF, ALWAYS_LATCH, ALWAYS_COMB }; enum en { ALWAYS, ALWAYS_FF, ALWAYS_LATCH, ALWAYS_COMB };
enum en m_e; enum en m_e;
inline VAlwaysKwd() inline VAlwaysKwd()
: m_e(ALWAYS) {} : m_e{ALWAYS} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VAlwaysKwd(en _e) inline VAlwaysKwd(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VAlwaysKwd(int _e) explicit inline VAlwaysKwd(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
const char* ascii() const { const char* ascii() const {
static const char* const names[] = {"always", "always_ff", "always_latch", "always_comb"}; static const char* const names[] = {"always", "always_ff", "always_latch", "always_comb"};
@ -827,12 +827,12 @@ public:
enum en { CT_CASE, CT_CASEX, CT_CASEZ, CT_CASEINSIDE }; enum en { CT_CASE, CT_CASEX, CT_CASEZ, CT_CASEINSIDE };
enum en m_e; enum en m_e;
inline VCaseType() inline VCaseType()
: m_e(CT_CASE) {} : m_e{CT_CASE} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VCaseType(en _e) inline VCaseType(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VCaseType(int _e) explicit inline VCaseType(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
}; };
inline bool operator==(const VCaseType& lhs, const VCaseType& rhs) { return lhs.m_e == rhs.m_e; } inline bool operator==(const VCaseType& lhs, const VCaseType& rhs) { return lhs.m_e == rhs.m_e; }
@ -846,12 +846,12 @@ public:
enum en { DT_DISPLAY, DT_WRITE, DT_INFO, DT_ERROR, DT_WARNING, DT_FATAL }; enum en { DT_DISPLAY, DT_WRITE, DT_INFO, DT_ERROR, DT_WARNING, DT_FATAL };
enum en m_e; enum en m_e;
inline AstDisplayType() inline AstDisplayType()
: m_e(DT_DISPLAY) {} : m_e{DT_DISPLAY} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline AstDisplayType(en _e) inline AstDisplayType(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline AstDisplayType(int _e) explicit inline AstDisplayType(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
bool addNewline() const { return m_e != DT_WRITE; } bool addNewline() const { return m_e != DT_WRITE; }
bool needScopeTracking() const { return m_e != DT_DISPLAY && m_e != DT_WRITE; } bool needScopeTracking() const { return m_e != DT_DISPLAY && m_e != DT_WRITE; }
@ -878,12 +878,12 @@ public:
enum en { FILE, VARS, ALL, FLUSH, LIMIT, OFF, ON }; enum en { FILE, VARS, ALL, FLUSH, LIMIT, OFF, ON };
enum en m_e; enum en m_e;
inline VDumpCtlType() inline VDumpCtlType()
: m_e(ON) {} : m_e{ON} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VDumpCtlType(en _e) inline VDumpCtlType(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VDumpCtlType(int _e) explicit inline VDumpCtlType(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
const char* ascii() const { const char* ascii() const {
static const char* const names[] = {"$dumpfile", "$dumpvars", "$dumpall", "$dumpflush", static const char* const names[] = {"$dumpfile", "$dumpvars", "$dumpall", "$dumpflush",
@ -908,12 +908,12 @@ public:
}; };
enum en m_e; enum en m_e;
inline VParseRefExp() inline VParseRefExp()
: m_e(PX_NONE) {} : m_e{PX_NONE} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VParseRefExp(en _e) inline VParseRefExp(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VParseRefExp(int _e) explicit inline VParseRefExp(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
const char* ascii() const { const char* ascii() const {
static const char* const names[] = {"", "$root", "TEXT", "PREDOT"}; static const char* const names[] = {"", "$root", "TEXT", "PREDOT"};
@ -959,19 +959,19 @@ public:
// //
class LeftRight {}; class LeftRight {};
VNumRange() VNumRange()
: m_hi(0) : m_hi{0}
, m_lo(0) , m_lo{0}
, mu_flags(0) {} , mu_flags{0} {}
VNumRange(int hi, int lo, bool littleEndian) VNumRange(int hi, int lo, bool littleEndian)
: m_hi(0) : m_hi{0}
, m_lo(0) , m_lo{0}
, mu_flags(0) { , mu_flags{0} {
init(hi, lo, littleEndian); init(hi, lo, littleEndian);
} }
VNumRange(LeftRight, int left, int right) VNumRange(LeftRight, int left, int right)
: m_hi(0) : m_hi{0}
, m_lo(0) , m_lo{0}
, mu_flags(0) { , mu_flags{0} {
init((right > left) ? right : left, (right > left) ? left : right, (right > left)); init((right > left) ? right : left, (right > left) ? left : right, (right > left));
} }
~VNumRange() {} ~VNumRange() {}
@ -1022,12 +1022,12 @@ public:
}; };
enum en m_e; enum en m_e;
inline VUseType() inline VUseType()
: m_e(IMP_FWD_CLASS) {} : m_e{IMP_FWD_CLASS} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VUseType(en _e) inline VUseType(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VUseType(int _e) explicit inline VUseType(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
bool isInclude() const { return m_e == IMP_INCLUDE || m_e == INT_INCLUDE; } bool isInclude() const { return m_e == IMP_INCLUDE || m_e == INT_INCLUDE; }
bool isFwdClass() const { return m_e == IMP_FWD_CLASS || m_e == INT_FWD_CLASS; } bool isFwdClass() const { return m_e == IMP_FWD_CLASS || m_e == INT_FWD_CLASS; }
operator en() const { return m_e; } operator en() const { return m_e; }
@ -1071,11 +1071,11 @@ public:
} }
VBasicTypeKey(int width, int widthMin, VSigning numeric, AstBasicDTypeKwd kwd, VBasicTypeKey(int width, int widthMin, VSigning numeric, AstBasicDTypeKwd kwd,
const VNumRange& nrange) const VNumRange& nrange)
: m_width(width) : m_width{width}
, m_widthMin(widthMin) , m_widthMin{widthMin}
, m_numeric(numeric) , m_numeric{numeric}
, m_keyword(kwd) , m_keyword{kwd}
, m_nrange(nrange) {} , m_nrange{nrange} {}
~VBasicTypeKey() {} ~VBasicTypeKey() {}
}; };
@ -1437,11 +1437,11 @@ public:
protected: protected:
// CONSTRUCTORS // CONSTRUCTORS
AstNode(AstType t) AstNode(AstType t)
: m_type(t) { : m_type{t} {
init(); init();
} }
AstNode(AstType t, FileLine* fl) AstNode(AstType t, FileLine* fl)
: m_type(t) { : m_type{t} {
init(); init();
m_fileline = fl; m_fileline = fl;
} }
@ -1880,7 +1880,7 @@ class AstNodeMath : public AstNode {
// Math -- anything that's part of an expression tree // Math -- anything that's part of an expression tree
public: public:
AstNodeMath(AstType t, FileLine* fl) AstNodeMath(AstType t, FileLine* fl)
: AstNode(t, fl) {} : AstNode{t, fl} {}
ASTNODE_BASE_FUNCS(NodeMath) ASTNODE_BASE_FUNCS(NodeMath)
// METHODS // METHODS
virtual bool hasDType() const override { return true; } virtual bool hasDType() const override { return true; }
@ -1899,7 +1899,7 @@ class AstNodeTermop : public AstNodeMath {
// Terminal operator -- a operator with no "inputs" // Terminal operator -- a operator with no "inputs"
public: public:
AstNodeTermop(AstType t, FileLine* fl) AstNodeTermop(AstType t, FileLine* fl)
: AstNodeMath(t, fl) {} : AstNodeMath{t, fl} {}
ASTNODE_BASE_FUNCS(NodeTermop) ASTNODE_BASE_FUNCS(NodeTermop)
// Know no children, and hot function, so skip iterator for speed // Know no children, and hot function, so skip iterator for speed
// See checkTreeIter also that asserts no children // See checkTreeIter also that asserts no children
@ -1911,7 +1911,7 @@ class AstNodeUniop : public AstNodeMath {
// Unary math // Unary math
public: public:
AstNodeUniop(AstType t, FileLine* fl, AstNode* lhsp) AstNodeUniop(AstType t, FileLine* fl, AstNode* lhsp)
: AstNodeMath(t, fl) { : AstNodeMath{t, fl} {
dtypeFrom(lhsp); dtypeFrom(lhsp);
setOp1p(lhsp); setOp1p(lhsp);
} }
@ -1936,7 +1936,7 @@ class AstNodeBiop : public AstNodeMath {
// Binary math // Binary math
public: public:
AstNodeBiop(AstType t, FileLine* fl, AstNode* lhs, AstNode* rhs) AstNodeBiop(AstType t, FileLine* fl, AstNode* lhs, AstNode* rhs)
: AstNodeMath(t, fl) { : AstNodeMath{t, fl} {
setOp1p(lhs); setOp1p(lhs);
setOp2p(rhs); setOp2p(rhs);
} }
@ -1968,7 +1968,7 @@ class AstNodeTriop : public AstNodeMath {
// Trinary math // Trinary math
public: public:
AstNodeTriop(AstType t, FileLine* fl, AstNode* lhs, AstNode* rhs, AstNode* ths) AstNodeTriop(AstType t, FileLine* fl, AstNode* lhs, AstNode* rhs, AstNode* ths)
: AstNodeMath(t, fl) { : AstNodeMath{t, fl} {
setOp1p(lhs); setOp1p(lhs);
setOp2p(rhs); setOp2p(rhs);
setOp3p(ths); setOp3p(ths);
@ -2000,7 +2000,7 @@ class AstNodeQuadop : public AstNodeMath {
// Quaternary math // Quaternary math
public: public:
AstNodeQuadop(AstType t, FileLine* fl, AstNode* lhs, AstNode* rhs, AstNode* ths, AstNode* fhs) AstNodeQuadop(AstType t, FileLine* fl, AstNode* lhs, AstNode* rhs, AstNode* ths, AstNode* fhs)
: AstNodeMath(t, fl) { : AstNodeMath{t, fl} {
setOp1p(lhs); setOp1p(lhs);
setOp2p(rhs); setOp2p(rhs);
setOp3p(ths); setOp3p(ths);
@ -2037,7 +2037,7 @@ class AstNodeBiCom : public AstNodeBiop {
// Binary math with commutative properties // Binary math with commutative properties
public: public:
AstNodeBiCom(AstType t, FileLine* fl, AstNode* lhs, AstNode* rhs) AstNodeBiCom(AstType t, FileLine* fl, AstNode* lhs, AstNode* rhs)
: AstNodeBiop(t, fl, lhs, rhs) {} : AstNodeBiop{t, fl, lhs, rhs} {}
ASTNODE_BASE_FUNCS(NodeBiCom) ASTNODE_BASE_FUNCS(NodeBiCom)
}; };
@ -2045,13 +2045,13 @@ class AstNodeBiComAsv : public AstNodeBiCom {
// Binary math with commutative & associative properties // Binary math with commutative & associative properties
public: public:
AstNodeBiComAsv(AstType t, FileLine* fl, AstNode* lhs, AstNode* rhs) AstNodeBiComAsv(AstType t, FileLine* fl, AstNode* lhs, AstNode* rhs)
: AstNodeBiCom(t, fl, lhs, rhs) {} : AstNodeBiCom{t, fl, lhs, rhs} {}
ASTNODE_BASE_FUNCS(NodeBiComAsv) ASTNODE_BASE_FUNCS(NodeBiComAsv)
}; };
class AstNodeCond : public AstNodeTriop { class AstNodeCond : public AstNodeTriop {
public: public:
AstNodeCond(AstType t, FileLine* fl, AstNode* condp, AstNode* expr1p, AstNode* expr2p) AstNodeCond(AstType t, FileLine* fl, AstNode* condp, AstNode* expr1p, AstNode* expr2p)
: AstNodeTriop(t, fl, condp, expr1p, expr2p) { : AstNodeTriop{t, fl, condp, expr1p, expr2p} {
if (expr1p) { if (expr1p) {
dtypeFrom(expr1p); dtypeFrom(expr1p);
} else if (expr2p) { } else if (expr2p) {
@ -2088,8 +2088,8 @@ private:
bool m_unnamed; // Originally unnamed (name change does not affect this) bool m_unnamed; // Originally unnamed (name change does not affect this)
public: public:
AstNodeBlock(AstType t, FileLine* fl, const string& name, AstNode* stmtsp) AstNodeBlock(AstType t, FileLine* fl, const string& name, AstNode* stmtsp)
: AstNode(t, fl) : AstNode{t, fl}
, m_name(name) { , m_name{name} {
addNOp1p(stmtsp); addNOp1p(stmtsp);
m_unnamed = (name == ""); m_unnamed = (name == "");
} }
@ -2107,7 +2107,7 @@ class AstNodePreSel : public AstNode {
// Something that becomes an AstSel // Something that becomes an AstSel
public: public:
AstNodePreSel(AstType t, FileLine* fl, AstNode* lhs, AstNode* rhs, AstNode* ths) AstNodePreSel(AstType t, FileLine* fl, AstNode* lhs, AstNode* rhs, AstNode* ths)
: AstNode(t, fl) { : AstNode{t, fl} {
setOp1p(lhs); setOp1p(lhs);
setOp2p(rhs); setOp2p(rhs);
setNOp3p(ths); setNOp3p(ths);
@ -2131,7 +2131,7 @@ class AstNodeProcedure : public AstNode {
// IEEE procedure: initial, final, always // IEEE procedure: initial, final, always
public: public:
AstNodeProcedure(AstType t, FileLine* fl, AstNode* bodysp) AstNodeProcedure(AstType t, FileLine* fl, AstNode* bodysp)
: AstNode(t, fl) { : AstNode{t, fl} {
addNOp2p(bodysp); addNOp2p(bodysp);
} }
ASTNODE_BASE_FUNCS(NodeProcedure) ASTNODE_BASE_FUNCS(NodeProcedure)
@ -2146,8 +2146,8 @@ class AstNodeStmt : public AstNode {
bool m_statement; // Really a statement (e.g. not a function with return) bool m_statement; // Really a statement (e.g. not a function with return)
public: public:
AstNodeStmt(AstType t, FileLine* fl, bool statement = true) AstNodeStmt(AstType t, FileLine* fl, bool statement = true)
: AstNode(t, fl) : AstNode{t, fl}
, m_statement(statement) {} , m_statement{statement} {}
ASTNODE_BASE_FUNCS(NodeStmt) ASTNODE_BASE_FUNCS(NodeStmt)
// METHODS // METHODS
bool isStatement() const { return m_statement; } // Really a statement bool isStatement() const { return m_statement; } // Really a statement
@ -2159,7 +2159,7 @@ public:
class AstNodeAssign : public AstNodeStmt { class AstNodeAssign : public AstNodeStmt {
public: public:
AstNodeAssign(AstType t, FileLine* fl, AstNode* lhsp, AstNode* rhsp) AstNodeAssign(AstType t, FileLine* fl, AstNode* lhsp, AstNode* rhsp)
: AstNodeStmt(t, fl) { : AstNodeStmt{t, fl} {
setOp1p(rhsp); setOp1p(rhsp);
setOp2p(lhsp); setOp2p(lhsp);
dtypeFrom(lhsp); dtypeFrom(lhsp);
@ -2185,7 +2185,7 @@ class AstNodeFor : public AstNodeStmt {
public: public:
AstNodeFor(AstType t, FileLine* fl, AstNode* initsp, AstNode* condp, AstNode* incsp, AstNodeFor(AstType t, FileLine* fl, AstNode* initsp, AstNode* condp, AstNode* incsp,
AstNode* bodysp) AstNode* bodysp)
: AstNodeStmt(t, fl) { : AstNodeStmt{t, fl} {
addNOp1p(initsp); addNOp1p(initsp);
setOp2p(condp); setOp2p(condp);
addNOp3p(incsp); addNOp3p(incsp);
@ -2207,7 +2207,7 @@ private:
VBranchPred m_branchPred; // Branch prediction as taken/untaken? VBranchPred m_branchPred; // Branch prediction as taken/untaken?
public: public:
AstNodeIf(AstType t, FileLine* fl, AstNode* condp, AstNode* ifsp, AstNode* elsesp) AstNodeIf(AstType t, FileLine* fl, AstNode* condp, AstNode* ifsp, AstNode* elsesp)
: AstNodeStmt(t, fl) { : AstNodeStmt{t, fl} {
setOp1p(condp); setOp1p(condp);
addNOp2p(ifsp); addNOp2p(ifsp);
addNOp3p(elsesp); addNOp3p(elsesp);
@ -2231,7 +2231,7 @@ public:
class AstNodeCase : public AstNodeStmt { class AstNodeCase : public AstNodeStmt {
public: public:
AstNodeCase(AstType t, FileLine* fl, AstNode* exprp, AstNode* casesp) AstNodeCase(AstType t, FileLine* fl, AstNode* exprp, AstNode* casesp)
: AstNodeStmt(t, fl) { : AstNodeStmt{t, fl} {
setOp1p(exprp); setOp1p(exprp);
addNOp2p(casesp); addNOp2p(casesp);
} }
@ -2259,15 +2259,15 @@ private:
public: public:
AstNodeVarRef(AstType t, FileLine* fl, const string& name, bool lvalue) AstNodeVarRef(AstType t, FileLine* fl, const string& name, bool lvalue)
: AstNodeMath(t, fl) : AstNodeMath{t, fl}
, m_lvalue(lvalue) , m_lvalue{lvalue}
, m_name(name) { , m_name{name} {
this->varp(nullptr); this->varp(nullptr);
} }
AstNodeVarRef(AstType t, FileLine* fl, const string& name, AstVar* varp, bool lvalue) AstNodeVarRef(AstType t, FileLine* fl, const string& name, AstVar* varp, bool lvalue)
: AstNodeMath(t, fl) : AstNodeMath{t, fl}
, m_lvalue(lvalue) , m_lvalue{lvalue}
, m_name(name) { , m_name{name} {
// May have varp==nullptr // May have varp==nullptr
this->varp(varp); this->varp(varp);
} }
@ -2304,7 +2304,7 @@ private:
public: public:
// Node that simply puts text into the output stream // Node that simply puts text into the output stream
AstNodeText(AstType t, FileLine* fl, const string& textp) AstNodeText(AstType t, FileLine* fl, const string& textp)
: AstNode(t, fl) { : AstNode{t, fl} {
m_text = textp; // Copy it m_text = textp; // Copy it
} }
ASTNODE_BASE_FUNCS(NodeText) ASTNODE_BASE_FUNCS(NodeText)
@ -2333,7 +2333,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
AstNodeDType(AstType t, FileLine* fl) AstNodeDType(AstType t, FileLine* fl)
: AstNode(t, fl) { : AstNode{t, fl} {
m_width = 0; m_width = 0;
m_widthMin = 0; m_widthMin = 0;
m_generic = false; m_generic = false;
@ -2421,7 +2421,7 @@ private:
public: public:
AstNodeUOrStructDType(AstType t, FileLine* fl, VSigning numericUnpack) AstNodeUOrStructDType(AstType t, FileLine* fl, VSigning numericUnpack)
: AstNodeDType(t, fl) { : AstNodeDType{t, fl} {
// VSigning::NOSIGN overloaded to indicate not packed // VSigning::NOSIGN overloaded to indicate not packed
m_packed = (numericUnpack != VSigning::NOSIGN); m_packed = (numericUnpack != VSigning::NOSIGN);
m_isFourstate = false; // V3Width computes m_isFourstate = false; // V3Width computes
@ -2477,13 +2477,11 @@ class AstNodeArrayDType : public AstNodeDType {
// Children: DTYPE (moved to refDTypep() in V3Width) // Children: DTYPE (moved to refDTypep() in V3Width)
// Children: RANGE (array bounds) // Children: RANGE (array bounds)
private: private:
AstNodeDType* m_refDTypep; // Elements of this type (after widthing) AstNodeDType* m_refDTypep = nullptr; // Elements of this type (after widthing)
AstNode* rangenp() const { return op2p(); } // op2 = Array(s) of variable AstNode* rangenp() const { return op2p(); } // op2 = Array(s) of variable
public: public:
AstNodeArrayDType(AstType t, FileLine* fl) AstNodeArrayDType(AstType t, FileLine* fl)
: AstNodeDType(t, fl) { : AstNodeDType{t, fl} {}
m_refDTypep = nullptr;
}
ASTNODE_BASE_FUNCS(NodeArrayDType) ASTNODE_BASE_FUNCS(NodeArrayDType)
virtual void dump(std::ostream& str) const override; virtual void dump(std::ostream& str) const override;
virtual void dumpSmall(std::ostream& str) const override; virtual void dumpSmall(std::ostream& str) const override;
@ -2541,7 +2539,7 @@ class AstNodeSel : public AstNodeBiop {
// Single bit range extraction, perhaps with non-constant selection or array selection // Single bit range extraction, perhaps with non-constant selection or array selection
public: public:
AstNodeSel(AstType t, FileLine* fl, AstNode* fromp, AstNode* bitp) AstNodeSel(AstType t, FileLine* fl, AstNode* fromp, AstNode* bitp)
: AstNodeBiop(t, fl, fromp, bitp) {} : AstNodeBiop{t, fl, fromp, bitp} {}
ASTNODE_BASE_FUNCS(NodeSel) ASTNODE_BASE_FUNCS(NodeSel)
AstNode* fromp() const { AstNode* fromp() const {
return op1p(); return op1p();
@ -2557,7 +2555,7 @@ class AstNodeStream : public AstNodeBiop {
// Verilog {rhs{lhs}} - Note rhsp() is the slice size, not the lhsp() // Verilog {rhs{lhs}} - Note rhsp() is the slice size, not the lhsp()
public: public:
AstNodeStream(AstType t, FileLine* fl, AstNode* lhsp, AstNode* rhsp) AstNodeStream(AstType t, FileLine* fl, AstNode* lhsp, AstNode* rhsp)
: AstNodeBiop(t, fl, lhsp, rhsp) { : AstNodeBiop{t, fl, lhsp, rhsp} {
if (lhsp->dtypep()) { dtypeSetLogicSized(lhsp->dtypep()->width(), VSigning::UNSIGNED); } if (lhsp->dtypep()) { dtypeSetLogicSized(lhsp->dtypep()->width(), VSigning::UNSIGNED); }
} }
ASTNODE_BASE_FUNCS(NodeStream) ASTNODE_BASE_FUNCS(NodeStream)
@ -2575,16 +2573,15 @@ class AstNodeCCall : public AstNodeStmt {
public: public:
AstNodeCCall(AstType t, FileLine* fl, AstCFunc* funcp, AstNode* argsp = nullptr) AstNodeCCall(AstType t, FileLine* fl, AstCFunc* funcp, AstNode* argsp = nullptr)
: AstNodeStmt(t, fl, true) : AstNodeStmt{t, fl, true}
, m_funcp(funcp) { , m_funcp{funcp} {
addNOp2p(argsp); addNOp2p(argsp);
} }
// Replacement form for V3Combine // Replacement form for V3Combine
// Note this removes old attachments from the oldp // Note this removes old attachments from the oldp
AstNodeCCall(AstType t, AstNodeCCall* oldp, AstCFunc* funcp) AstNodeCCall(AstType t, AstNodeCCall* oldp, AstCFunc* funcp)
: AstNodeStmt(t, oldp->fileline(), true) : AstNodeStmt{t, oldp->fileline(), true}
, m_funcp(funcp) { , m_funcp{funcp} {
m_funcp = funcp;
m_hiername = oldp->hiername(); m_hiername = oldp->hiername();
m_argTypes = oldp->argTypes(); m_argTypes = oldp->argTypes();
if (oldp->argsp()) addNOp2p(oldp->argsp()->unlinkFrBackWithNext()); if (oldp->argsp()) addNOp2p(oldp->argsp()->unlinkFrBackWithNext());
@ -2637,22 +2634,22 @@ private:
VLifetime m_lifetime; // Lifetime VLifetime m_lifetime; // Lifetime
public: public:
AstNodeFTask(AstType t, FileLine* fl, const string& name, AstNode* stmtsp) AstNodeFTask(AstType t, FileLine* fl, const string& name, AstNode* stmtsp)
: AstNode(t, fl) : AstNode{t, fl}
, m_name(name) , m_name{name}
, m_taskPublic(false) , m_taskPublic{false}
, m_attrIsolateAssign(false) , m_attrIsolateAssign{false}
, m_classMethod(false) , m_classMethod{false}
, m_extern(false) , m_extern{false}
, m_prototype(false) , m_prototype{false}
, m_dpiExport(false) , m_dpiExport{false}
, m_dpiImport(false) , m_dpiImport{false}
, m_dpiContext(false) , m_dpiContext{false}
, m_dpiOpenChild(false) , m_dpiOpenChild{false}
, m_dpiTask(false) , m_dpiTask{false}
, m_isConstructor(false) , m_isConstructor{false}
, m_pure(false) , m_pure{false}
, m_pureVirtual(false) , m_pureVirtual{false}
, m_virtual(false) { , m_virtual{false} {
addNOp3p(stmtsp); addNOp3p(stmtsp);
cname(name); // Might be overridden by dpi import/export cname(name); // Might be overridden by dpi import/export
} }
@ -2725,13 +2722,13 @@ private:
bool m_pli = false; // Pli system call ($name) bool m_pli = false; // Pli system call ($name)
public: public:
AstNodeFTaskRef(AstType t, FileLine* fl, bool statement, AstNode* namep, AstNode* pinsp) AstNodeFTaskRef(AstType t, FileLine* fl, bool statement, AstNode* namep, AstNode* pinsp)
: AstNodeStmt(t, fl, statement) { : AstNodeStmt{t, fl, statement} {
setOp1p(namep); setOp1p(namep);
addNOp3p(pinsp); addNOp3p(pinsp);
} }
AstNodeFTaskRef(AstType t, FileLine* fl, bool statement, const string& name, AstNode* pinsp) AstNodeFTaskRef(AstType t, FileLine* fl, bool statement, const string& name, AstNode* pinsp)
: AstNodeStmt(t, fl, statement) : AstNodeStmt{t, fl, statement}
, m_name(name) { , m_name{name} {
addNOp3p(pinsp); addNOp3p(pinsp);
} }
ASTNODE_BASE_FUNCS(NodeFTaskRef) ASTNODE_BASE_FUNCS(NodeFTaskRef)
@ -2794,17 +2791,17 @@ private:
VOptionBool m_unconnectedDrive; // State of `unconnected_drive VOptionBool m_unconnectedDrive; // State of `unconnected_drive
public: public:
AstNodeModule(AstType t, FileLine* fl, const string& name) AstNodeModule(AstType t, FileLine* fl, const string& name)
: AstNode(t, fl) : AstNode{t, fl}
, m_name(name) , m_name{name}
, m_origName(name) , m_origName{name}
, m_modPublic(false) , m_modPublic{false}
, m_modTrace(false) , m_modTrace{false}
, m_inLibrary(false) , m_inLibrary{false}
, m_dead(false) , m_dead{false}
, m_hierBlock(false) , m_hierBlock{false}
, m_internal(false) , m_internal{false}
, m_recursive(false) , m_recursive{false}
, m_recursiveClone(false) {} , m_recursiveClone{false} {}
ASTNODE_BASE_FUNCS(NodeModule) ASTNODE_BASE_FUNCS(NodeModule)
virtual void dump(std::ostream& str) const override; virtual void dump(std::ostream& str) const override;
virtual bool maybePointedTo() const override { return true; } virtual bool maybePointedTo() const override { return true; }
@ -2853,7 +2850,7 @@ class AstNodeRange : public AstNode {
// A range, sized or unsized // A range, sized or unsized
public: public:
AstNodeRange(AstType t, FileLine* fl) AstNodeRange(AstType t, FileLine* fl)
: AstNode(t, fl) {} : AstNode{t, fl} {}
ASTNODE_BASE_FUNCS(NodeRange) ASTNODE_BASE_FUNCS(NodeRange)
}; };

View File

@ -369,8 +369,8 @@ public:
AstParamTypeDType(FileLine* fl, AstVarType type, const string& name, VFlagChildDType, AstParamTypeDType(FileLine* fl, AstVarType type, const string& name, VFlagChildDType,
AstNodeDType* dtp) AstNodeDType* dtp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_varType(type) , m_varType{type}
, m_name(name) { , m_name{name} {
childDTypep(dtp); // Only for parser childDTypep(dtp); // Only for parser
dtypep(nullptr); // V3Width will resolve dtypep(nullptr); // V3Width will resolve
} }
@ -413,7 +413,7 @@ public:
AstTypedef(FileLine* fl, const string& name, AstNode* attrsp, VFlagChildDType, AstTypedef(FileLine* fl, const string& name, AstNode* attrsp, VFlagChildDType,
AstNodeDType* dtp) AstNodeDType* dtp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) { , m_name{name} {
childDTypep(dtp); // Only for parser childDTypep(dtp); // Only for parser
addAttrsp(attrsp); addAttrsp(attrsp);
dtypep(nullptr); // V3Width will resolve dtypep(nullptr); // V3Width will resolve
@ -447,7 +447,7 @@ private:
public: public:
AstTypedefFwd(FileLine* fl, const string& name) AstTypedefFwd(FileLine* fl, const string& name)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) {} , m_name{name} {}
ASTNODE_NODE_FUNCS(TypedefFwd) ASTNODE_NODE_FUNCS(TypedefFwd)
// METHODS // METHODS
virtual string name() const override { return m_name; } virtual string name() const override { return m_name; }
@ -468,8 +468,8 @@ public:
AstDefImplicitDType(FileLine* fl, const string& name, void* containerp, VFlagChildDType, AstDefImplicitDType(FileLine* fl, const string& name, void* containerp, VFlagChildDType,
AstNodeDType* dtp) AstNodeDType* dtp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) , m_name{name}
, m_containerp(containerp) { , m_containerp{containerp} {
childDTypep(dtp); // Only for parser childDTypep(dtp); // Only for parser
dtypep(nullptr); // V3Width will resolve dtypep(nullptr); // V3Width will resolve
m_uniqueNum = uniqueNumInc(); m_uniqueNum = uniqueNumInc();
@ -980,7 +980,7 @@ private:
public: public:
AstClassRefDType(FileLine* fl, AstClass* classp) AstClassRefDType(FileLine* fl, AstClass* classp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_classp(classp) { , m_classp{classp} {
dtypep(this); dtypep(this);
} }
ASTNODE_NODE_FUNCS(ClassRefDType) ASTNODE_NODE_FUNCS(ClassRefDType)
@ -1033,17 +1033,17 @@ private:
public: public:
AstIfaceRefDType(FileLine* fl, const string& cellName, const string& ifaceName) AstIfaceRefDType(FileLine* fl, const string& cellName, const string& ifaceName)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_modportFileline(nullptr) , m_modportFileline{nullptr}
, m_cellName(cellName) , m_cellName{cellName}
, m_ifaceName(ifaceName) , m_ifaceName{ifaceName}
, m_modportName("") {} , m_modportName{""} {}
AstIfaceRefDType(FileLine* fl, FileLine* modportFl, const string& cellName, AstIfaceRefDType(FileLine* fl, FileLine* modportFl, const string& cellName,
const string& ifaceName, const string& modport) const string& ifaceName, const string& modport)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_modportFileline(modportFl) , m_modportFileline{modportFl}
, m_cellName(cellName) , m_cellName{cellName}
, m_ifaceName(ifaceName) , m_ifaceName{ifaceName}
, m_modportName(modport) {} , m_modportName{modport} {}
ASTNODE_NODE_FUNCS(IfaceRefDType) ASTNODE_NODE_FUNCS(IfaceRefDType)
// METHODS // METHODS
virtual const char* broken() const override; virtual const char* broken() const override;
@ -1149,10 +1149,10 @@ private:
public: public:
AstRefDType(FileLine* fl, const string& name) AstRefDType(FileLine* fl, const string& name)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) {} , m_name{name} {}
AstRefDType(FileLine* fl, const string& name, AstNode* classOrPackagep, AstNode* paramsp) AstRefDType(FileLine* fl, const string& name, AstNode* classOrPackagep, AstNode* paramsp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) { , m_name{name} {
setNOp3p(classOrPackagep); setNOp3p(classOrPackagep);
addNOp4p(paramsp); addNOp4p(paramsp);
} }
@ -1269,14 +1269,14 @@ private:
public: public:
AstMemberDType(FileLine* fl, const string& name, VFlagChildDType, AstNodeDType* dtp) AstMemberDType(FileLine* fl, const string& name, VFlagChildDType, AstNodeDType* dtp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) { , m_name{name} {
childDTypep(dtp); // Only for parser childDTypep(dtp); // Only for parser
dtypep(nullptr); // V3Width will resolve dtypep(nullptr); // V3Width will resolve
refDTypep(nullptr); refDTypep(nullptr);
} }
AstMemberDType(FileLine* fl, const string& name, AstNodeDType* dtp) AstMemberDType(FileLine* fl, const string& name, AstNodeDType* dtp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) { , m_name{name} {
UASSERT(dtp, "AstMember created with no dtype"); UASSERT(dtp, "AstMember created with no dtype");
refDTypep(dtp); refDTypep(dtp);
dtypep(this); dtypep(this);
@ -1355,7 +1355,7 @@ public:
// Parents: ENUM // Parents: ENUM
AstEnumItem(FileLine* fl, const string& name, AstNode* rangep, AstNode* initp) AstEnumItem(FileLine* fl, const string& name, AstNode* rangep, AstNode* initp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) { , m_name{name} {
addNOp1p(rangep); addNOp1p(rangep);
addNOp2p(initp); addNOp2p(initp);
} }
@ -1377,8 +1377,8 @@ private:
public: public:
AstEnumItemRef(FileLine* fl, AstEnumItem* itemp, AstNodeModule* packagep) AstEnumItemRef(FileLine* fl, AstEnumItem* itemp, AstNodeModule* packagep)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_itemp(itemp) , m_itemp{itemp}
, m_packagep(packagep) { , m_packagep{packagep} {
dtypeFrom(m_itemp); dtypeFrom(m_itemp);
} }
ASTNODE_NODE_FUNCS(EnumItemRef) ASTNODE_NODE_FUNCS(EnumItemRef)
@ -1671,15 +1671,15 @@ private:
int m_declElWidth; // If a packed array, the number of bits per element int m_declElWidth; // If a packed array, the number of bits per element
public: public:
AstSel(FileLine* fl, AstNode* fromp, AstNode* lsbp, AstNode* widthp) AstSel(FileLine* fl, AstNode* fromp, AstNode* lsbp, AstNode* widthp)
: ASTGEN_SUPER(fl, fromp, lsbp, widthp) { : ASTGEN_SUPER(fl, fromp, lsbp, widthp)
m_declElWidth = 1; , m_declElWidth{1} {
if (VN_IS(widthp, Const)) { if (VN_IS(widthp, Const)) {
dtypeSetLogicSized(VN_CAST(widthp, Const)->toUInt(), VSigning::UNSIGNED); dtypeSetLogicSized(VN_CAST(widthp, Const)->toUInt(), VSigning::UNSIGNED);
} }
} }
AstSel(FileLine* fl, AstNode* fromp, int lsb, int bitwidth) AstSel(FileLine* fl, AstNode* fromp, int lsb, int bitwidth)
: ASTGEN_SUPER(fl, fromp, new AstConst(fl, lsb), new AstConst(fl, bitwidth)) { : ASTGEN_SUPER(fl, fromp, new AstConst(fl, lsb), new AstConst(fl, bitwidth))
m_declElWidth = 1; , m_declElWidth{1} {
dtypeSetLogicSized(bitwidth, VSigning::UNSIGNED); dtypeSetLogicSized(bitwidth, VSigning::UNSIGNED);
} }
ASTNODE_NODE_FUNCS(Sel) ASTNODE_NODE_FUNCS(Sel)
@ -1730,7 +1730,7 @@ public:
AstSliceSel(FileLine* fl, AstNode* fromp, const VNumRange& declRange) AstSliceSel(FileLine* fl, AstNode* fromp, const VNumRange& declRange)
: ASTGEN_SUPER(fl, fromp, new AstConst(fl, declRange.lo()), : ASTGEN_SUPER(fl, fromp, new AstConst(fl, declRange.lo()),
new AstConst(fl, declRange.elements())) new AstConst(fl, declRange.elements()))
, m_declRange(declRange) {} , m_declRange{declRange} {}
ASTNODE_NODE_FUNCS(SliceSel) ASTNODE_NODE_FUNCS(SliceSel)
virtual void dump(std::ostream& str) const override; virtual void dump(std::ostream& str) const override;
virtual void numberOperate(V3Number& out, const V3Number& from, const V3Number& lo, virtual void numberOperate(V3Number& out, const V3Number& from, const V3Number& lo,
@ -1803,14 +1803,14 @@ public:
AstCMethodHard(FileLine* fl, AstNode* fromp, VFlagChildDType, const string& name, AstCMethodHard(FileLine* fl, AstNode* fromp, VFlagChildDType, const string& name,
AstNode* pinsp) AstNode* pinsp)
: ASTGEN_SUPER(fl, false) : ASTGEN_SUPER(fl, false)
, m_name(name) { , m_name{name} {
setOp1p(fromp); setOp1p(fromp);
dtypep(nullptr); // V3Width will resolve dtypep(nullptr); // V3Width will resolve
addNOp2p(pinsp); addNOp2p(pinsp);
} }
AstCMethodHard(FileLine* fl, AstNode* fromp, const string& name, AstNode* pinsp) AstCMethodHard(FileLine* fl, AstNode* fromp, const string& name, AstNode* pinsp)
: ASTGEN_SUPER(fl, false) : ASTGEN_SUPER(fl, false)
, m_name(name) { , m_name{name} {
setOp1p(fromp); setOp1p(fromp);
addNOp2p(pinsp); addNOp2p(pinsp);
} }
@ -1922,8 +1922,8 @@ private:
public: public:
AstVar(FileLine* fl, AstVarType type, const string& name, VFlagChildDType, AstNodeDType* dtp) AstVar(FileLine* fl, AstVarType type, const string& name, VFlagChildDType, AstNodeDType* dtp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) , m_name{name}
, m_origName(name) { , m_origName{name} {
init(); init();
combineType(type); combineType(type);
childDTypep(dtp); // Only for parser childDTypep(dtp); // Only for parser
@ -1936,8 +1936,8 @@ public:
} }
AstVar(FileLine* fl, AstVarType type, const string& name, AstNodeDType* dtp) AstVar(FileLine* fl, AstVarType type, const string& name, AstNodeDType* dtp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) , m_name{name}
, m_origName(name) { , m_origName{name} {
init(); init();
combineType(type); combineType(type);
UASSERT(dtp, "AstVar created with no dtype"); UASSERT(dtp, "AstVar created with no dtype");
@ -1950,8 +1950,8 @@ public:
} }
AstVar(FileLine* fl, AstVarType type, const string& name, VFlagLogicPacked, int wantwidth) AstVar(FileLine* fl, AstVarType type, const string& name, VFlagLogicPacked, int wantwidth)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) , m_name{name}
, m_origName(name) { , m_origName{name} {
init(); init();
combineType(type); combineType(type);
dtypeSetLogicSized(wantwidth, VSigning::UNSIGNED); dtypeSetLogicSized(wantwidth, VSigning::UNSIGNED);
@ -1959,8 +1959,8 @@ public:
} }
AstVar(FileLine* fl, AstVarType type, const string& name, VFlagBitPacked, int wantwidth) AstVar(FileLine* fl, AstVarType type, const string& name, VFlagBitPacked, int wantwidth)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) , m_name{name}
, m_origName(name) { , m_origName{name} {
init(); init();
combineType(type); combineType(type);
dtypeSetBitSized(wantwidth, VSigning::UNSIGNED); dtypeSetBitSized(wantwidth, VSigning::UNSIGNED);
@ -1968,8 +1968,8 @@ public:
} }
AstVar(FileLine* fl, AstVarType type, const string& name, AstVar* examplep) AstVar(FileLine* fl, AstVarType type, const string& name, AstVar* examplep)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) , m_name{name}
, m_origName(name) { , m_origName{name} {
init(); init();
combineType(type); combineType(type);
if (examplep->childDTypep()) { childDTypep(examplep->childDTypep()->cloneTree(true)); } if (examplep->childDTypep()) { childDTypep(examplep->childDTypep()->cloneTree(true)); }
@ -2223,10 +2223,10 @@ public:
AstScope(FileLine* fl, AstNodeModule* modp, const string& name, AstScope* aboveScopep, AstScope(FileLine* fl, AstNodeModule* modp, const string& name, AstScope* aboveScopep,
AstCell* aboveCellp) AstCell* aboveCellp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) , m_name{name}
, m_aboveScopep(aboveScopep) , m_aboveScopep{aboveScopep}
, m_aboveCellp(aboveCellp) , m_aboveCellp{aboveCellp}
, m_modp(modp) {} , m_modp{modp} {}
ASTNODE_NODE_FUNCS(Scope) ASTNODE_NODE_FUNCS(Scope)
virtual void cloneRelink() override; virtual void cloneRelink() override;
virtual const char* broken() const override; virtual const char* broken() const override;
@ -2277,8 +2277,8 @@ private:
public: public:
AstVarScope(FileLine* fl, AstScope* scopep, AstVar* varp) AstVarScope(FileLine* fl, AstScope* scopep, AstVar* varp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_scopep(scopep) , m_scopep{scopep}
, m_varp(varp) { , m_varp{varp} {
m_circular = false; m_circular = false;
m_trace = true; m_trace = true;
dtypeFrom(varp); dtypeFrom(varp);
@ -2365,10 +2365,10 @@ private:
public: public:
AstVarXRef(FileLine* fl, const string& name, const string& dotted, bool lvalue) AstVarXRef(FileLine* fl, const string& name, const string& dotted, bool lvalue)
: ASTGEN_SUPER(fl, name, nullptr, lvalue) : ASTGEN_SUPER(fl, name, nullptr, lvalue)
, m_dotted(dotted) {} , m_dotted{dotted} {}
AstVarXRef(FileLine* fl, AstVar* varp, const string& dotted, bool lvalue) AstVarXRef(FileLine* fl, AstVar* varp, const string& dotted, bool lvalue)
: ASTGEN_SUPER(fl, varp->name(), varp, lvalue) : ASTGEN_SUPER(fl, varp->name(), varp, lvalue)
, m_dotted(dotted) { , m_dotted{dotted} {
dtypeFrom(varp); dtypeFrom(varp);
} }
ASTNODE_NODE_FUNCS(VarXRef) ASTNODE_NODE_FUNCS(VarXRef)
@ -2402,14 +2402,14 @@ private:
public: public:
AstPin(FileLine* fl, int pinNum, const string& name, AstNode* exprp) AstPin(FileLine* fl, int pinNum, const string& name, AstNode* exprp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) { , m_pinNum{pinNum}
m_pinNum = pinNum; , m_name{name} {
setNOp1p(exprp); setNOp1p(exprp);
} }
AstPin(FileLine* fl, int pinNum, AstVarRef* varname, AstNode* exprp) AstPin(FileLine* fl, int pinNum, AstVarRef* varname, AstNode* exprp)
: ASTGEN_SUPER(fl) { : ASTGEN_SUPER(fl)
m_name = varname->name(); , m_pinNum{pinNum}
m_pinNum = pinNum; , m_name{varname->name()} {
setNOp1p(exprp); setNOp1p(exprp);
} }
ASTNODE_NODE_FUNCS(Pin) ASTNODE_NODE_FUNCS(Pin)
@ -2451,7 +2451,7 @@ private:
public: public:
AstArg(FileLine* fl, const string& name, AstNode* exprp) AstArg(FileLine* fl, const string& name, AstNode* exprp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) { , m_name{name} {
setNOp1p(exprp); setNOp1p(exprp);
} }
ASTNODE_NODE_FUNCS(Arg) ASTNODE_NODE_FUNCS(Arg)
@ -2471,7 +2471,7 @@ private:
public: public:
AstModule(FileLine* fl, const string& name, bool program = false) AstModule(FileLine* fl, const string& name, bool program = false)
: ASTGEN_SUPER(fl, name) : ASTGEN_SUPER(fl, name)
, m_isProgram(program) {} , m_isProgram{program} {}
ASTNODE_NODE_FUNCS(Module) ASTNODE_NODE_FUNCS(Module)
virtual string verilogKwd() const override { return m_isProgram ? "program" : "module"; } virtual string verilogKwd() const override { return m_isProgram ? "program" : "module"; }
}; };
@ -2522,8 +2522,8 @@ private:
public: public:
AstPackageExport(FileLine* fl, AstPackage* packagep, const string& name) AstPackageExport(FileLine* fl, AstPackage* packagep, const string& name)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) , m_name{name}
, m_packagep(packagep) {} , m_packagep{packagep} {}
ASTNODE_NODE_FUNCS(PackageExport) ASTNODE_NODE_FUNCS(PackageExport)
virtual const char* broken() const override { virtual const char* broken() const override {
BROKEN_RTN(!m_packagep || !m_packagep->brokeExists()); BROKEN_RTN(!m_packagep || !m_packagep->brokeExists());
@ -2546,8 +2546,8 @@ private:
public: public:
AstPackageImport(FileLine* fl, AstPackage* packagep, const string& name) AstPackageImport(FileLine* fl, AstPackage* packagep, const string& name)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) , m_name{name}
, m_packagep(packagep) {} , m_packagep{packagep} {}
ASTNODE_NODE_FUNCS(PackageImport) ASTNODE_NODE_FUNCS(PackageImport)
virtual const char* broken() const override { virtual const char* broken() const override {
BROKEN_RTN(!m_packagep || !m_packagep->brokeExists()); BROKEN_RTN(!m_packagep || !m_packagep->brokeExists());
@ -2580,13 +2580,13 @@ private:
public: public:
AstMemberSel(FileLine* fl, AstNode* fromp, VFlagChildDType, const string& name) AstMemberSel(FileLine* fl, AstNode* fromp, VFlagChildDType, const string& name)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) { , m_name{name} {
setOp1p(fromp); setOp1p(fromp);
dtypep(nullptr); // V3Width will resolve dtypep(nullptr); // V3Width will resolve
} }
AstMemberSel(FileLine* fl, AstNode* fromp, AstNodeDType* dtp) AstMemberSel(FileLine* fl, AstNode* fromp, AstNodeDType* dtp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(dtp->name()) { , m_name{dtp->name()} {
setOp1p(fromp); setOp1p(fromp);
dtypep(dtp); dtypep(dtp);
} }
@ -2628,8 +2628,8 @@ private:
public: public:
AstModportFTaskRef(FileLine* fl, const string& name, bool isExport) AstModportFTaskRef(FileLine* fl, const string& name, bool isExport)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) , m_name{name}
, m_export(isExport) {} , m_export{isExport} {}
ASTNODE_NODE_FUNCS(ModportFTaskRef) ASTNODE_NODE_FUNCS(ModportFTaskRef)
virtual const char* broken() const override { virtual const char* broken() const override {
BROKEN_RTN(m_ftaskp && !m_ftaskp->brokeExists()); BROKEN_RTN(m_ftaskp && !m_ftaskp->brokeExists());
@ -2657,8 +2657,8 @@ private:
public: public:
AstModportVarRef(FileLine* fl, const string& name, VDirection::en direction) AstModportVarRef(FileLine* fl, const string& name, VDirection::en direction)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) , m_name{name}
, m_direction(direction) {} , m_direction{direction} {}
ASTNODE_NODE_FUNCS(ModportVarRef) ASTNODE_NODE_FUNCS(ModportVarRef)
virtual const char* broken() const override { virtual const char* broken() const override {
BROKEN_RTN(m_varp && !m_varp->brokeExists()); BROKEN_RTN(m_varp && !m_varp->brokeExists());
@ -2682,7 +2682,7 @@ private:
public: public:
AstModport(FileLine* fl, const string& name, AstNode* varsp) AstModport(FileLine* fl, const string& name, AstNode* varsp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) { , m_name{name} {
addNOp1p(varsp); addNOp1p(varsp);
} }
virtual string name() const override { return m_name; } virtual string name() const override { return m_name; }
@ -2698,7 +2698,7 @@ private:
public: public:
AstIntfRef(FileLine* fl, const string& name) AstIntfRef(FileLine* fl, const string& name)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) {} , m_name{name} {}
virtual string name() const override { return m_name; } virtual string name() const override { return m_name; }
ASTNODE_NODE_FUNCS(IntfRef) ASTNODE_NODE_FUNCS(IntfRef)
}; };
@ -2718,13 +2718,13 @@ public:
AstCell(FileLine* fl, FileLine* mfl, const string& instName, const string& modName, AstCell(FileLine* fl, FileLine* mfl, const string& instName, const string& modName,
AstPin* pinsp, AstPin* paramsp, AstRange* rangep) AstPin* pinsp, AstPin* paramsp, AstRange* rangep)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_modNameFileline(mfl) , m_modNameFileline{mfl}
, m_name(instName) , m_name{instName}
, m_origName(instName) , m_origName{instName}
, m_modName(modName) , m_modName{modName}
, m_hasIfaceVar(false) , m_hasIfaceVar{false}
, m_recursive(false) , m_recursive{false}
, m_trace(true) { , m_trace{true} {
addNOp1p(pinsp); addNOp1p(pinsp);
addNOp2p(paramsp); addNOp2p(paramsp);
setNOp3p(rangep); setNOp3p(rangep);
@ -2780,9 +2780,9 @@ public:
AstCellInline(FileLine* fl, const string& name, const string& origModName, AstCellInline(FileLine* fl, const string& name, const string& origModName,
const VTimescale& timeunit) const VTimescale& timeunit)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) , m_name{name}
, m_origModName(origModName) , m_origModName{origModName}
, m_timeunit(timeunit) {} , m_timeunit{timeunit} {}
ASTNODE_NODE_FUNCS(CellInline) ASTNODE_NODE_FUNCS(CellInline)
virtual void dump(std::ostream& str) const override; virtual void dump(std::ostream& str) const override;
virtual const char* broken() const override { virtual const char* broken() const override {
@ -2806,7 +2806,7 @@ private:
public: public:
AstCellRef(FileLine* fl, const string& name, AstNode* cellp, AstNode* exprp) AstCellRef(FileLine* fl, const string& name, AstNode* cellp, AstNode* exprp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) { , m_name{name} {
addNOp1p(cellp); addNOp1p(cellp);
addNOp2p(exprp); addNOp2p(exprp);
} }
@ -2824,7 +2824,7 @@ private:
public: public:
AstCellArrayRef(FileLine* fl, const string& name, AstNode* selectExprp) AstCellArrayRef(FileLine* fl, const string& name, AstNode* selectExprp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) { , m_name{name} {
addNOp1p(selectExprp); addNOp1p(selectExprp);
} }
ASTNODE_NODE_FUNCS(CellArrayRef) ASTNODE_NODE_FUNCS(CellArrayRef)
@ -2840,7 +2840,7 @@ private:
public: public:
AstUnlinkedRef(FileLine* fl, AstNode* refp, const string& name, AstNode* crp) AstUnlinkedRef(FileLine* fl, AstNode* refp, const string& name, AstNode* crp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) { , m_name{name} {
addNOp1p(refp); addNOp1p(refp);
addNOp2p(crp); addNOp2p(crp);
} }
@ -2859,7 +2859,7 @@ private:
public: public:
AstBind(FileLine* fl, const string& name, AstNode* cellsp) AstBind(FileLine* fl, const string& name, AstNode* cellsp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) { , m_name{name} {
UASSERT_OBJ(VN_IS(cellsp, Cell), cellsp, "Only cells allowed to be bound"); UASSERT_OBJ(VN_IS(cellsp, Cell), cellsp, "Only cells allowed to be bound");
addNOp1p(cellsp); addNOp1p(cellsp);
} }
@ -2878,8 +2878,8 @@ private:
public: public:
AstPort(FileLine* fl, int pinnum, const string& name) AstPort(FileLine* fl, int pinnum, const string& name)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_pinNum(pinnum) , m_pinNum{pinnum}
, m_name(name) {} , m_name{name} {}
ASTNODE_NODE_FUNCS(Port) ASTNODE_NODE_FUNCS(Port)
virtual string name() const override { return m_name; } // * = Port name virtual string name() const override { return m_name; } // * = Port name
int pinNum() const { return m_pinNum; } // * = Pin number, for order based instantiation int pinNum() const { return m_pinNum; } // * = Pin number, for order based instantiation
@ -2902,8 +2902,8 @@ public:
AstParseRef(FileLine* fl, VParseRefExp expect, const string& name, AstNode* lhsp = nullptr, AstParseRef(FileLine* fl, VParseRefExp expect, const string& name, AstNode* lhsp = nullptr,
AstNodeFTaskRef* ftaskrefp = nullptr) AstNodeFTaskRef* ftaskrefp = nullptr)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_expect(expect) , m_expect{expect}
, m_name(name) { , m_name{name} {
setNOp1p(lhsp); setNOp1p(lhsp);
setNOp2p(ftaskrefp); setNOp2p(ftaskrefp);
} }
@ -2932,8 +2932,8 @@ public:
AstClassOrPackageRef(FileLine* fl, const string& name, AstNode* classOrPackagep, AstClassOrPackageRef(FileLine* fl, const string& name, AstNode* classOrPackagep,
AstNode* paramsp) AstNode* paramsp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) , m_name{name}
, m_classOrPackagep(classOrPackagep) { , m_classOrPackagep{classOrPackagep} {
addNOp4p(paramsp); addNOp4p(paramsp);
} }
ASTNODE_NODE_FUNCS(ClassOrPackageRef) ASTNODE_NODE_FUNCS(ClassOrPackageRef)
@ -2967,7 +2967,7 @@ class AstDot : public AstNode {
public: public:
AstDot(FileLine* fl, bool colon, AstNode* lhsp, AstNode* rhsp) AstDot(FileLine* fl, bool colon, AstNode* lhsp, AstNode* rhsp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_colon(colon) { , m_colon{colon} {
setOp1p(lhsp); setOp1p(lhsp);
setOp2p(rhsp); setOp2p(rhsp);
} }
@ -3051,8 +3051,8 @@ private:
public: public:
AstDpiExport(FileLine* fl, const string& vname, const string& cname) AstDpiExport(FileLine* fl, const string& vname, const string& cname)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(vname) , m_name{vname}
, m_cname(cname) {} , m_cname{cname} {}
ASTNODE_NODE_FUNCS(DpiExport) ASTNODE_NODE_FUNCS(DpiExport)
virtual string name() const override { return m_name; } virtual string name() const override { return m_name; }
virtual void name(const string& name) override { m_name = name; } virtual void name(const string& name) override { m_name = name; }
@ -3090,29 +3090,24 @@ public:
class Never {}; // for creator type-overload selection class Never {}; // for creator type-overload selection
AstSenItem(FileLine* fl, VEdgeType edgeType, AstNode* varrefp) AstSenItem(FileLine* fl, VEdgeType edgeType, AstNode* varrefp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_edgeType(edgeType) { , m_edgeType{edgeType} {
setOp1p(varrefp); setOp1p(varrefp);
} }
AstSenItem(FileLine* fl, Combo) AstSenItem(FileLine* fl, Combo)
: ASTGEN_SUPER(fl) { : ASTGEN_SUPER(fl)
m_edgeType = VEdgeType::ET_COMBO; , m_edgeType{VEdgeType::ET_COMBO} {}
}
AstSenItem(FileLine* fl, Illegal) AstSenItem(FileLine* fl, Illegal)
: ASTGEN_SUPER(fl) { : ASTGEN_SUPER(fl)
m_edgeType = VEdgeType::ET_ILLEGAL; , m_edgeType{VEdgeType::ET_ILLEGAL} {}
}
AstSenItem(FileLine* fl, Initial) AstSenItem(FileLine* fl, Initial)
: ASTGEN_SUPER(fl) { : ASTGEN_SUPER(fl)
m_edgeType = VEdgeType::ET_INITIAL; , m_edgeType{VEdgeType::ET_INITIAL} {}
}
AstSenItem(FileLine* fl, Settle) AstSenItem(FileLine* fl, Settle)
: ASTGEN_SUPER(fl) { : ASTGEN_SUPER(fl)
m_edgeType = VEdgeType::ET_SETTLE; , m_edgeType{VEdgeType::ET_SETTLE} {}
}
AstSenItem(FileLine* fl, Never) AstSenItem(FileLine* fl, Never)
: ASTGEN_SUPER(fl) { : ASTGEN_SUPER(fl)
m_edgeType = VEdgeType::ET_NEVER; , m_edgeType{VEdgeType::ET_NEVER} {}
}
ASTNODE_NODE_FUNCS(SenItem) ASTNODE_NODE_FUNCS(SenItem)
virtual void dump(std::ostream& str) const override; virtual void dump(std::ostream& str) const override;
virtual V3Hash sameHash() const override { return V3Hash(edgeType()); } virtual V3Hash sameHash() const override { return V3Hash(edgeType()); }
@ -3185,7 +3180,7 @@ class AstAlways : public AstNodeProcedure {
public: public:
AstAlways(FileLine* fl, VAlwaysKwd keyword, AstSenTree* sensesp, AstNode* bodysp) AstAlways(FileLine* fl, VAlwaysKwd keyword, AstSenTree* sensesp, AstNode* bodysp)
: ASTGEN_SUPER(fl, bodysp) : ASTGEN_SUPER(fl, bodysp)
, m_keyword(keyword) { , m_keyword{keyword} {
addNOp1p(sensesp); addNOp1p(sensesp);
} }
ASTNODE_NODE_FUNCS(Always) ASTNODE_NODE_FUNCS(Always)
@ -3356,8 +3351,8 @@ private:
public: public:
AstComment(FileLine* fl, const string& name, bool showAt = false) AstComment(FileLine* fl, const string& name, bool showAt = false)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_showAt(showAt) , m_showAt{showAt}
, m_name(name) {} , m_name{name} {}
ASTNODE_NODE_FUNCS(Comment) ASTNODE_NODE_FUNCS(Comment)
virtual string name() const override { return m_name; } // * = Text virtual string name() const override { return m_name; } // * = Text
virtual V3Hash sameHash() const override { return V3Hash(); } // Ignore name in comments virtual V3Hash sameHash() const override { return V3Hash(); } // Ignore name in comments
@ -3462,9 +3457,8 @@ private:
AstCoverDecl* m_declp; // [After V3Coverage] Pointer to declaration AstCoverDecl* m_declp; // [After V3Coverage] Pointer to declaration
public: public:
AstCoverInc(FileLine* fl, AstCoverDecl* declp) AstCoverInc(FileLine* fl, AstCoverDecl* declp)
: ASTGEN_SUPER(fl) { : ASTGEN_SUPER(fl)
m_declp = declp; , m_declp{declp} {}
}
ASTNODE_NODE_FUNCS(CoverInc) ASTNODE_NODE_FUNCS(CoverInc)
virtual const char* broken() const override { virtual const char* broken() const override {
BROKEN_RTN(!declp()->brokeExists()); BROKEN_RTN(!declp()->brokeExists());
@ -3546,21 +3540,15 @@ class AstCase : public AstNodeCase {
// casesp Children: CASEITEMs // casesp Children: CASEITEMs
private: private:
VCaseType m_casex; // 0=case, 1=casex, 2=casez VCaseType m_casex; // 0=case, 1=casex, 2=casez
bool m_fullPragma; // Synthesis full_case bool m_fullPragma = false; // Synthesis full_case
bool m_parallelPragma; // Synthesis parallel_case bool m_parallelPragma = false; // Synthesis parallel_case
bool m_uniquePragma; // unique case bool m_uniquePragma = false; // unique case
bool m_unique0Pragma; // unique0 case bool m_unique0Pragma = false; // unique0 case
bool m_priorityPragma; // priority case bool m_priorityPragma = false; // priority case
public: public:
AstCase(FileLine* fl, VCaseType casex, AstNode* exprp, AstNode* casesp) AstCase(FileLine* fl, VCaseType casex, AstNode* exprp, AstNode* casesp)
: ASTGEN_SUPER(fl, exprp, casesp) { : ASTGEN_SUPER(fl, exprp, casesp)
m_casex = casex; , m_casex{casex} {}
m_fullPragma = false;
m_parallelPragma = false;
m_uniquePragma = false;
m_unique0Pragma = false;
m_priorityPragma = false;
}
ASTNODE_NODE_FUNCS(Case) ASTNODE_NODE_FUNCS(Case)
virtual string verilogKwd() const override { virtual string verilogKwd() const override {
return casez() ? "casez" : casex() ? "casex" : "case"; return casez() ? "casez" : casex() ? "casex" : "case";
@ -3591,13 +3579,12 @@ class AstCaseItem : public AstNode {
// condsp Children: MATH (Null condition used for default block) // condsp Children: MATH (Null condition used for default block)
// bodysp Children: Statements // bodysp Children: Statements
private: private:
bool m_ignoreOverlap; // Default created by assertions; ignore overlaps bool m_ignoreOverlap = false; // Default created by assertions; ignore overlaps
public: public:
AstCaseItem(FileLine* fl, AstNode* condsp, AstNode* bodysp) AstCaseItem(FileLine* fl, AstNode* condsp, AstNode* bodysp)
: ASTGEN_SUPER(fl) { : ASTGEN_SUPER(fl) {
addNOp1p(condsp); addNOp1p(condsp);
addNOp2p(bodysp); addNOp2p(bodysp);
m_ignoreOverlap = false;
} }
ASTNODE_NODE_FUNCS(CaseItem) ASTNODE_NODE_FUNCS(CaseItem)
virtual int instrCount() const override { return widthInstrs() + instrCountBranch(); } virtual int instrCount() const override { return widthInstrs() + instrCountBranch(); }
@ -3623,10 +3610,10 @@ public:
AstSFormatF(FileLine* fl, const string& text, bool hidden, AstNode* exprsp, AstSFormatF(FileLine* fl, const string& text, bool hidden, AstNode* exprsp,
char missingArgChar = 'd') char missingArgChar = 'd')
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_text(text) , m_text{text}
, m_hidden(hidden) , m_hidden{hidden}
, m_hasFormat(true) , m_hasFormat{true}
, m_missingArgChar(missingArgChar) { , m_missingArgChar{missingArgChar} {
dtypeSetString(); dtypeSetString();
addNOp1p(exprsp); addNOp1p(exprsp);
addNOp2p(nullptr); addNOp2p(nullptr);
@ -3634,10 +3621,10 @@ public:
AstSFormatF(FileLine* fl, NoFormat, AstNode* exprsp, char missingArgChar = 'd', AstSFormatF(FileLine* fl, NoFormat, AstNode* exprsp, char missingArgChar = 'd',
bool hidden = true) bool hidden = true)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_text("") , m_text{""}
, m_hidden(hidden) , m_hidden{hidden}
, m_hasFormat(false) , m_hasFormat{false}
, m_missingArgChar(missingArgChar) { , m_missingArgChar{missingArgChar} {
dtypeSetString(); dtypeSetString();
addNOp1p(exprsp); addNOp1p(exprsp);
addNOp2p(nullptr); addNOp2p(nullptr);
@ -3730,7 +3717,7 @@ class AstDumpCtl : public AstNodeStmt {
public: public:
AstDumpCtl(FileLine* fl, VDumpCtlType ctlType, AstNode* exprp = nullptr) AstDumpCtl(FileLine* fl, VDumpCtlType ctlType, AstNode* exprp = nullptr)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_ctlType(ctlType) { , m_ctlType{ctlType} {
setNOp1p(exprp); setNOp1p(exprp);
} }
ASTNODE_NODE_FUNCS(DumpCtl) ASTNODE_NODE_FUNCS(DumpCtl)
@ -4076,7 +4063,7 @@ private:
public: public:
AstFScanF(FileLine* fl, const string& text, AstNode* filep, AstNode* exprsp) AstFScanF(FileLine* fl, const string& text, AstNode* filep, AstNode* exprsp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_text(text) { , m_text{text} {
addNOp1p(exprsp); addNOp1p(exprsp);
setNOp2p(filep); setNOp2p(filep);
} }
@ -4112,7 +4099,7 @@ private:
public: public:
AstSScanF(FileLine* fl, const string& text, AstNode* fromp, AstNode* exprsp) AstSScanF(FileLine* fl, const string& text, AstNode* fromp, AstNode* exprsp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_text(text) { , m_text{text} {
addNOp1p(exprsp); addNOp1p(exprsp);
setOp2p(fromp); setOp2p(fromp);
} }
@ -4264,7 +4251,7 @@ private:
public: public:
AstTestPlusArgs(FileLine* fl, const string& text) AstTestPlusArgs(FileLine* fl, const string& text)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_text(text) {} , m_text{text} {}
ASTNODE_NODE_FUNCS(TestPlusArgs) ASTNODE_NODE_FUNCS(TestPlusArgs)
virtual string name() const override { return m_text; } virtual string name() const override { return m_text; }
virtual string verilogKwd() const override { return "$test$plusargs"; } virtual string verilogKwd() const override { return "$test$plusargs"; }
@ -4390,7 +4377,7 @@ private:
public: public:
AstDisable(FileLine* fl, const string& name) AstDisable(FileLine* fl, const string& name)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_name(name) {} , m_name{name} {}
ASTNODE_NODE_FUNCS(Disable) ASTNODE_NODE_FUNCS(Disable)
virtual string name() const override { return m_name; } // * = Block name virtual string name() const override { return m_name; } // * = Block name
virtual void name(const string& flag) override { m_name = flag; } virtual void name(const string& flag) override { m_name = flag; }
@ -4498,7 +4485,7 @@ private:
public: public:
AstJumpLabel(FileLine* fl, AstJumpBlock* blockp) AstJumpLabel(FileLine* fl, AstJumpBlock* blockp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_blockp(blockp) {} , m_blockp{blockp} {}
ASTNODE_NODE_FUNCS(JumpLabel) ASTNODE_NODE_FUNCS(JumpLabel)
virtual bool maybePointedTo() const override { return true; } virtual bool maybePointedTo() const override { return true; }
virtual const char* broken() const override { virtual const char* broken() const override {
@ -4528,7 +4515,7 @@ private:
public: public:
AstJumpGo(FileLine* fl, AstJumpLabel* labelp) AstJumpGo(FileLine* fl, AstJumpLabel* labelp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_labelp(labelp) {} , m_labelp{labelp} {}
ASTNODE_NODE_FUNCS(JumpGo); ASTNODE_NODE_FUNCS(JumpGo);
virtual const char* broken() const override { virtual const char* broken() const override {
BROKEN_RTN(!labelp()->brokeExistsBelow()); BROKEN_RTN(!labelp()->brokeExistsBelow());
@ -4612,10 +4599,9 @@ public:
// Node that simply puts name into the output stream // Node that simply puts name into the output stream
AstBegin(FileLine* fl, const string& name, AstNode* stmtsp, bool generate = false, AstBegin(FileLine* fl, const string& name, AstNode* stmtsp, bool generate = false,
bool implied = false) bool implied = false)
: ASTGEN_SUPER(fl, name, stmtsp) { : ASTGEN_SUPER(fl, name, stmtsp)
m_generate = generate; , m_generate{generate}
m_implied = implied; , m_implied{implied} {}
}
ASTNODE_NODE_FUNCS(Begin) ASTNODE_NODE_FUNCS(Begin)
virtual void dump(std::ostream& str) const override; virtual void dump(std::ostream& str) const override;
// op1p is statements in NodeBlock // op1p is statements in NodeBlock
@ -4833,9 +4819,8 @@ public:
// Pragmas don't result in any output code, they're just flags that affect // Pragmas don't result in any output code, they're just flags that affect
// other processing in verilator. // other processing in verilator.
AstPragma(FileLine* fl, AstPragmaType pragType) AstPragma(FileLine* fl, AstPragmaType pragType)
: ASTGEN_SUPER(fl) { : ASTGEN_SUPER(fl)
m_pragType = pragType; , m_pragType{pragType} {}
}
ASTNODE_NODE_FUNCS(Pragma) ASTNODE_NODE_FUNCS(Pragma)
AstPragmaType pragType() const { return m_pragType; } // *=type of the pragma AstPragmaType pragType() const { return m_pragType; } // *=type of the pragma
virtual V3Hash sameHash() const override { return V3Hash(pragType()); } virtual V3Hash sameHash() const override { return V3Hash(pragType()); }
@ -4994,16 +4979,16 @@ public:
AstNode* valuep, const VNumRange& bitRange, const VNumRange& arrayRange, AstNode* valuep, const VNumRange& bitRange, const VNumRange& arrayRange,
bool isScoped) bool isScoped)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_showname(showname) , m_showname{showname}
, m_bitRange(bitRange) , m_bitRange{bitRange}
, m_arrayRange(arrayRange) , m_arrayRange{arrayRange}
, m_codeInc( , m_codeInc(
((arrayRange.ranged() ? arrayRange.elements() : 1) * valuep->dtypep()->widthWords() ((arrayRange.ranged() ? arrayRange.elements() : 1) * valuep->dtypep()->widthWords()
* (VL_EDATASIZE / 32))) // A code is always 32-bits * (VL_EDATASIZE / 32))) // A code is always 32-bits
, m_varType(varp->varType()) , m_varType{varp->varType()}
, m_declKwd(varp->declKwd()) , m_declKwd{varp->declKwd()}
, m_declDirection(varp->declDirection()) , m_declDirection{varp->declDirection()}
, m_isScoped(isScoped) { , m_isScoped{isScoped} {
dtypeFrom(valuep); dtypeFrom(valuep);
addNOp1p(valuep); addNOp1p(valuep);
} }
@ -5039,8 +5024,8 @@ private:
public: public:
AstTraceInc(FileLine* fl, AstTraceDecl* declp, bool full) AstTraceInc(FileLine* fl, AstTraceDecl* declp, bool full)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_declp(declp) , m_declp{declp}
, m_full(full) { , m_full{full} {
dtypeFrom(declp); dtypeFrom(declp);
addOp2p(declp->valuep()->cloneTree(true)); addOp2p(declp->valuep()->cloneTree(true));
} }
@ -5193,7 +5178,7 @@ class AstUdpTableLine : public AstNode {
public: public:
AstUdpTableLine(FileLine* fl, const string& text) AstUdpTableLine(FileLine* fl, const string& text)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_text(text) {} , m_text{text} {}
ASTNODE_NODE_FUNCS(UdpTableLine) ASTNODE_NODE_FUNCS(UdpTableLine)
virtual string name() const override { return m_text; } virtual string name() const override { return m_text; }
string text() const { return m_text; } string text() const { return m_text; }
@ -5208,13 +5193,13 @@ private:
bool m_reset; // Random reset, versus always random bool m_reset; // Random reset, versus always random
public: public:
AstRand(FileLine* fl, AstNodeDType* dtp, bool reset) AstRand(FileLine* fl, AstNodeDType* dtp, bool reset)
: ASTGEN_SUPER(fl) { : ASTGEN_SUPER(fl)
, m_reset{reset} {
dtypep(dtp); dtypep(dtp);
m_reset = reset;
} }
explicit AstRand(FileLine* fl) explicit AstRand(FileLine* fl)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_reset(false) {} , m_reset{false} {}
ASTNODE_NODE_FUNCS(Rand) ASTNODE_NODE_FUNCS(Rand)
virtual string emitVerilog() override { return "%f$random"; } virtual string emitVerilog() override { return "%f$random"; }
virtual string emitC() override { virtual string emitC() override {
@ -5233,7 +5218,7 @@ class AstTime : public AstNodeTermop {
public: public:
AstTime(FileLine* fl, const VTimescale& timeunit) AstTime(FileLine* fl, const VTimescale& timeunit)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_timeunit(timeunit) { , m_timeunit{timeunit} {
dtypeSetUInt64(); dtypeSetUInt64();
} }
ASTNODE_NODE_FUNCS(Time) ASTNODE_NODE_FUNCS(Time)
@ -5255,7 +5240,7 @@ class AstTimeD : public AstNodeTermop {
public: public:
AstTimeD(FileLine* fl, const VTimescale& timeunit) AstTimeD(FileLine* fl, const VTimescale& timeunit)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_timeunit(timeunit) { , m_timeunit{timeunit} {
dtypeSetDouble(); dtypeSetDouble();
} }
ASTNODE_NODE_FUNCS(TimeD) ASTNODE_NODE_FUNCS(TimeD)
@ -6265,7 +6250,7 @@ private:
public: public:
AstAtoN(FileLine* fl, AstNode* lhsp, FmtType fmt) AstAtoN(FileLine* fl, AstNode* lhsp, FmtType fmt)
: ASTGEN_SUPER(fl, lhsp) : ASTGEN_SUPER(fl, lhsp)
, m_fmt(fmt) { , m_fmt{fmt} {
fmt == ATOREAL ? dtypeSetDouble() : dtypeSetSigned32(); fmt == ATOREAL ? dtypeSetDouble() : dtypeSetSigned32();
} }
ASTNODE_NODE_FUNCS(AtoN) ASTNODE_NODE_FUNCS(AtoN)
@ -8017,7 +8002,7 @@ private:
public: public:
AstCompareNN(FileLine* fl, AstNode* lhsp, AstNode* rhsp, bool ignoreCase) AstCompareNN(FileLine* fl, AstNode* lhsp, AstNode* rhsp, bool ignoreCase)
: ASTGEN_SUPER(fl, lhsp, rhsp) : ASTGEN_SUPER(fl, lhsp, rhsp)
, m_ignoreCase(ignoreCase) { , m_ignoreCase{ignoreCase} {
dtypeSetUInt32(); dtypeSetUInt32();
} }
ASTNODE_NODE_FUNCS(CompareNN) ASTNODE_NODE_FUNCS(CompareNN)
@ -8180,13 +8165,12 @@ class AstPatMember : public AstNodeMath {
// Parents: AstPattern // Parents: AstPattern
// Children: expression, AstPattern, replication count // Children: expression, AstPattern, replication count
private: private:
bool m_default; bool m_default = false;
public: public:
AstPatMember(FileLine* fl, AstNode* lhsp, AstNode* keyp, AstNode* repp) AstPatMember(FileLine* fl, AstNode* lhsp, AstNode* keyp, AstNode* repp)
: ASTGEN_SUPER(fl) { : ASTGEN_SUPER(fl) {
addOp1p(lhsp), setNOp2p(keyp), setNOp3p(repp); addOp1p(lhsp), setNOp2p(keyp), setNOp3p(repp);
m_default = false;
} }
ASTNODE_NODE_FUNCS(PatMember) ASTNODE_NODE_FUNCS(PatMember)
virtual string emitVerilog() override { return lhssp() ? "%f{%r{%k%l}}" : "%l"; } virtual string emitVerilog() override { return lhssp() ? "%f{%r{%k%l}}" : "%l"; }
@ -8460,11 +8444,10 @@ private:
bool m_support : 1; ///< Support file (non systemc) bool m_support : 1; ///< Support file (non systemc)
public: public:
AstCFile(FileLine* fl, const string& name) AstCFile(FileLine* fl, const string& name)
: ASTGEN_SUPER(fl, name) { : ASTGEN_SUPER(fl, name)
m_slow = false; , m_slow{false}
m_source = false; , m_source{false}
m_support = false; , m_support{false} {}
}
ASTNODE_NODE_FUNCS(CFile) ASTNODE_NODE_FUNCS(CFile)
virtual void dump(std::ostream& str = std::cout) const override; virtual void dump(std::ostream& str = std::cout) const override;
bool slow() const { return m_slow; } bool slow() const { return m_slow; }
@ -8701,15 +8684,15 @@ public:
// Emit C textual math function (like AstUCFunc) // Emit C textual math function (like AstUCFunc)
AstCMath(FileLine* fl, AstNode* exprsp) AstCMath(FileLine* fl, AstNode* exprsp)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_cleanOut(true) , m_cleanOut{true}
, m_pure(false) { , m_pure{false} {
addOp1p(exprsp); addOp1p(exprsp);
dtypeFrom(exprsp); dtypeFrom(exprsp);
} }
AstCMath(FileLine* fl, const string& textStmt, int setwidth, bool cleanOut = true) AstCMath(FileLine* fl, const string& textStmt, int setwidth, bool cleanOut = true)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_cleanOut(cleanOut) , m_cleanOut{cleanOut}
, m_pure(true) { , m_pure{true} {
addNOp1p(new AstText(fl, textStmt, true)); addNOp1p(new AstText(fl, textStmt, true));
if (setwidth) { dtypeSetLogicSized(setwidth, VSigning::UNSIGNED); } if (setwidth) { dtypeSetLogicSized(setwidth, VSigning::UNSIGNED); }
} }
@ -8772,8 +8755,8 @@ private:
public: public:
AstCUse(FileLine* fl, VUseType useType, const string& name) AstCUse(FileLine* fl, VUseType useType, const string& name)
: ASTGEN_SUPER(fl) : ASTGEN_SUPER(fl)
, m_useType(useType) , m_useType{useType}
, m_name(name) {} , m_name{name} {}
ASTNODE_NODE_FUNCS(CUse) ASTNODE_NODE_FUNCS(CUse)
virtual string name() const override { return m_name; } virtual string name() const override { return m_name; }
virtual void dump(std::ostream& str = std::cout) const override; virtual void dump(std::ostream& str = std::cout) const override;

View File

@ -129,13 +129,13 @@ public:
// clang-format on // clang-format on
enum en m_e; enum en m_e;
inline V3ErrorCode() inline V3ErrorCode()
: m_e(EC_MIN) {} : m_e{EC_MIN} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline V3ErrorCode(en _e) inline V3ErrorCode(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit V3ErrorCode(const char* msgp); // Matching code or ERROR explicit V3ErrorCode(const char* msgp); // Matching code or ERROR
explicit inline V3ErrorCode(int _e) explicit inline V3ErrorCode(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
const char* ascii() const { const char* ascii() const {
// clang-format off // clang-format off

View File

@ -46,12 +46,12 @@ public:
enum en { LINT_WIDTH, MATCHES_WIDTH, VERILOG_WIDTH }; enum en { LINT_WIDTH, MATCHES_WIDTH, VERILOG_WIDTH };
enum en m_e; enum en m_e;
inline VWidthMinUsage() inline VWidthMinUsage()
: m_e(LINT_WIDTH) {} : m_e{LINT_WIDTH} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VWidthMinUsage(en _e) inline VWidthMinUsage(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VWidthMinUsage(int _e) explicit inline VWidthMinUsage(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
}; };
inline bool operator==(const VWidthMinUsage& lhs, const VWidthMinUsage& rhs) { inline bool operator==(const VWidthMinUsage& lhs, const VWidthMinUsage& rhs) {

View File

@ -55,12 +55,12 @@ public:
}; };
enum en m_e; enum en m_e;
inline GraphWay() inline GraphWay()
: m_e(FORWARD) {} : m_e{FORWARD} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline GraphWay(en _e) inline GraphWay(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline GraphWay(int _e) explicit inline GraphWay(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
const char* ascii() const { const char* ascii() const {
static const char* const names[] = {"FORWARD", "REVERSE"}; static const char* const names[] = {"FORWARD", "REVERSE"};

View File

@ -56,13 +56,13 @@ public:
// //
enum en m_e; enum en m_e;
inline V3LangCode() inline V3LangCode()
: m_e(L_ERROR) {} : m_e{L_ERROR} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline V3LangCode(en _e) inline V3LangCode(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit V3LangCode(const char* textp); explicit V3LangCode(const char* textp);
explicit inline V3LangCode(int _e) explicit inline V3LangCode(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
}; };

View File

@ -40,12 +40,12 @@ public:
enum en { OPT_DEFAULT_FALSE = 0, OPT_DEFAULT_TRUE, OPT_TRUE, OPT_FALSE, _ENUM_END }; enum en { OPT_DEFAULT_FALSE = 0, OPT_DEFAULT_TRUE, OPT_TRUE, OPT_FALSE, _ENUM_END };
enum en m_e; enum en m_e;
inline VOptionBool() inline VOptionBool()
: m_e(OPT_DEFAULT_FALSE) {} : m_e{OPT_DEFAULT_FALSE} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VOptionBool(en _e) inline VOptionBool(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VOptionBool(int _e) explicit inline VOptionBool(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
bool isDefault() const { return m_e == OPT_DEFAULT_FALSE || m_e == OPT_DEFAULT_TRUE; } bool isDefault() const { return m_e == OPT_DEFAULT_FALSE || m_e == OPT_DEFAULT_TRUE; }
bool isTrue() const { return m_e == OPT_TRUE || m_e == OPT_DEFAULT_TRUE; } bool isTrue() const { return m_e == OPT_TRUE || m_e == OPT_DEFAULT_TRUE; }
@ -87,12 +87,12 @@ public:
enum en m_e; enum en m_e;
// CONSTRUCTOR // CONSTRUCTOR
inline VTimescale() inline VTimescale()
: m_e(NONE) {} : m_e{NONE} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline VTimescale(en _e) inline VTimescale(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline VTimescale(int _e) explicit inline VTimescale(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
// Construct from string // Construct from string
VTimescale(const string& value, bool& badr); VTimescale(const string& value, bool& badr);
VTimescale(double value, bool& badr) { VTimescale(double value, bool& badr) {
@ -172,9 +172,9 @@ public:
enum en { VCD = 0, FST } m_e; enum en { VCD = 0, FST } m_e;
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline TraceFormat(en _e = VCD) inline TraceFormat(en _e = VCD)
: m_e(_e) {} : m_e{_e} {}
explicit inline TraceFormat(int _e) explicit inline TraceFormat(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
bool fst() const { return m_e == FST; } bool fst() const { return m_e == FST; }
string classBase() const { string classBase() const {

View File

@ -89,12 +89,12 @@ struct OrderVEdgeType {
} }
enum en m_e; enum en m_e;
inline OrderVEdgeType() inline OrderVEdgeType()
: m_e(VERTEX_UNKNOWN) {} : m_e{VERTEX_UNKNOWN} {}
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
inline OrderVEdgeType(en _e) inline OrderVEdgeType(en _e)
: m_e(_e) {} : m_e{_e} {}
explicit inline OrderVEdgeType(int _e) explicit inline OrderVEdgeType(int _e)
: m_e(static_cast<en>(_e)) {} : m_e{static_cast<en>(_e)} {}
operator en() const { return m_e; } operator en() const { return m_e; }
}; };
inline bool operator==(const OrderVEdgeType& lhs, const OrderVEdgeType& rhs) { inline bool operator==(const OrderVEdgeType& lhs, const OrderVEdgeType& rhs) {