diff --git a/src/V3AssertPre.cpp b/src/V3AssertPre.cpp index 59ca21019..50a405b13 100644 --- a/src/V3AssertPre.cpp +++ b/src/V3AssertPre.cpp @@ -134,8 +134,7 @@ private: AstNode* exprp = nodep->exprp()->unlinkFrBack(); AstNode* past = new AstPast(fl, exprp, nullptr); past->dtypeFrom(exprp); - exprp = new AstEq(fl, past, - exprp->cloneTree(false)); + exprp = new AstEq(fl, past, exprp->cloneTree(false)); exprp->dtypeSetLogicBool(); nodep->replaceWith(exprp); nodep->sentreep(newSenTree(nodep)); diff --git a/src/V3Ast.cpp b/src/V3Ast.cpp index b20a3b184..e8f8682ef 100644 --- a/src/V3Ast.cpp +++ b/src/V3Ast.cpp @@ -58,9 +58,10 @@ std::ostream& operator<<(std::ostream& os, AstType rhs); //###################################################################### // Creators -void AstNode::init() { +AstNode::AstNode(AstType t, FileLine* fl) + : m_type{t} + , m_fileline{fl} { editCountInc(); - m_fileline = nullptr; m_nextp = nullptr; m_backp = nullptr; m_headtailp = this; // When made, we're a list of only a single element diff --git a/src/V3Ast.h b/src/V3Ast.h index c7c44c5cb..18fe163c8 100644 --- a/src/V3Ast.h +++ b/src/V3Ast.h @@ -1449,7 +1449,6 @@ class AstNode { if (nodep) nodep->m_backp = this; } - void init(); // initialize value of AstNode private: AstNode* cloneTreeIter(); AstNode* cloneTreeIterList(); @@ -1469,15 +1468,7 @@ public: protected: // CONSTRUCTORS - AstNode(AstType t) - : m_type{t} { - init(); - } - AstNode(AstType t, FileLine* fl) - : m_type{t} { - init(); - m_fileline = fl; - } + AstNode(AstType t, FileLine* fl); virtual AstNode* clone() = 0; // Generally, cloneTree is what you want instead virtual void cloneRelink() {} void cloneRelinkTree();