mirror of
https://github.com/verilator/verilator.git
synced 2025-01-07 15:17:36 +00:00
Internals: refactor sameTreeIter. No functional change.
This commit is contained in:
parent
85b7f828b3
commit
c43e707f43
@ -1081,10 +1081,9 @@ bool AstNode::sameTreeIter(const AstNode* node1p, const AstNode* node2p, bool ig
|
||||
// private: Return true if the two trees are identical
|
||||
if (!node1p && !node2p) return true;
|
||||
if (!node1p || !node2p) return false;
|
||||
if (node1p->type() != node2p->type() || node1p->dtypep() != node2p->dtypep()
|
||||
|| !node1p->same(node2p) || (gateOnly && !node1p->isGateOptimizable())) {
|
||||
return false;
|
||||
}
|
||||
if (node1p->type() != node2p->type()) return false;
|
||||
if (node1p->dtypep() != node2p->dtypep()) return false;
|
||||
if (!node1p->same(node2p) || (gateOnly && !node1p->isGateOptimizable())) return false;
|
||||
return (sameTreeIter(node1p->m_op1p, node2p->m_op1p, false, gateOnly)
|
||||
&& sameTreeIter(node1p->m_op2p, node2p->m_op2p, false, gateOnly)
|
||||
&& sameTreeIter(node1p->m_op3p, node2p->m_op3p, false, gateOnly)
|
||||
|
Loading…
Reference in New Issue
Block a user