Internals: Remove unneeded constructor.

This commit is contained in:
Wilson Snyder 2020-09-15 07:35:53 -04:00
parent d07a6f81e4
commit 0765443353
3 changed files with 5 additions and 14 deletions

View File

@ -134,8 +134,7 @@ private:
AstNode* exprp = nodep->exprp()->unlinkFrBack(); AstNode* exprp = nodep->exprp()->unlinkFrBack();
AstNode* past = new AstPast(fl, exprp, nullptr); AstNode* past = new AstPast(fl, exprp, nullptr);
past->dtypeFrom(exprp); past->dtypeFrom(exprp);
exprp = new AstEq(fl, past, exprp = new AstEq(fl, past, exprp->cloneTree(false));
exprp->cloneTree(false));
exprp->dtypeSetLogicBool(); exprp->dtypeSetLogicBool();
nodep->replaceWith(exprp); nodep->replaceWith(exprp);
nodep->sentreep(newSenTree(nodep)); nodep->sentreep(newSenTree(nodep));

View File

@ -58,9 +58,10 @@ std::ostream& operator<<(std::ostream& os, AstType rhs);
//###################################################################### //######################################################################
// Creators // Creators
void AstNode::init() { AstNode::AstNode(AstType t, FileLine* fl)
: m_type{t}
, m_fileline{fl} {
editCountInc(); editCountInc();
m_fileline = nullptr;
m_nextp = nullptr; m_nextp = nullptr;
m_backp = nullptr; m_backp = nullptr;
m_headtailp = this; // When made, we're a list of only a single element m_headtailp = this; // When made, we're a list of only a single element

View File

@ -1449,7 +1449,6 @@ class AstNode {
if (nodep) nodep->m_backp = this; if (nodep) nodep->m_backp = this;
} }
void init(); // initialize value of AstNode
private: private:
AstNode* cloneTreeIter(); AstNode* cloneTreeIter();
AstNode* cloneTreeIterList(); AstNode* cloneTreeIterList();
@ -1469,15 +1468,7 @@ public:
protected: protected:
// CONSTRUCTORS // CONSTRUCTORS
AstNode(AstType t) AstNode(AstType t, FileLine* fl);
: m_type{t} {
init();
}
AstNode(AstType t, FileLine* fl)
: m_type{t} {
init();
m_fileline = fl;
}
virtual AstNode* clone() = 0; // Generally, cloneTree is what you want instead virtual AstNode* clone() = 0; // Generally, cloneTree is what you want instead
virtual void cloneRelink() {} virtual void cloneRelink() {}
void cloneRelinkTree(); void cloneRelinkTree();