Internals: Refactor InsideRange common code. No functional change intended.

This commit is contained in:
Wilson Snyder
2020-03-30 18:12:50 -04:00
parent 1fe5d5db79
commit 0cf44a9c4f
4 changed files with 15 additions and 18 deletions
+9
View File
@@ -193,6 +193,15 @@ AstExecGraph::~AstExecGraph() {
VL_DO_DANGLING(delete m_depGraphp, m_depGraphp);
}
AstNode* AstInsideRange::newAndFromInside(AstNode* exprp, AstNode* lhsp, AstNode* rhsp) {
AstNode* ap = new AstGte(fileline(), exprp->cloneTree(true), lhsp);
AstNode* bp = new AstLte(fileline(), exprp->cloneTree(true), rhsp);
ap->fileline()->modifyWarnOff(V3ErrorCode::UNSIGNED, true);
bp->fileline()->modifyWarnOff(V3ErrorCode::CMPCONST, true);
AstNode* newp = new AstAnd(fileline(), ap, bp);
return newp;
}
bool AstVar::isSigPublic() const {
return (m_sigPublic || (v3Global.opt.allPublic() && !isTemp() && !isGenVar()));
}