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* 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));

View File

@ -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

View File

@ -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();