mirror of
https://github.com/verilator/verilator.git
synced 2026-09-02 18:58:51 +02:00
Strengthen AstNode types to AstNodeExpr
Declare every AstNode children and variables as AstNodeExpr where we statically know this is the appropriate sub-type.
This commit is contained in:
+4
-4
@@ -336,7 +336,7 @@ private:
|
||||
AstNode* createLookupInput(FileLine* fl, AstVarScope* indexVscp) {
|
||||
// Concat inputs into a single temp variable (inside always)
|
||||
// First var in inVars becomes the LSB of the concat
|
||||
AstNode* concatp = nullptr;
|
||||
AstNodeExpr* concatp = nullptr;
|
||||
for (AstVarScope* invscp : m_inVarps) {
|
||||
AstVarRef* const refp = new AstVarRef{fl, invscp, VAccess::READ};
|
||||
if (concatp) {
|
||||
@@ -359,8 +359,8 @@ private:
|
||||
AstVarScope* outputAssignedTableVscp) {
|
||||
FileLine* const fl = nodep->fileline();
|
||||
for (TableOutputVar& tov : m_outVarps) {
|
||||
AstNode* const alhsp = new AstVarRef{fl, tov.varScopep(), VAccess::WRITE};
|
||||
AstNode* const arhsp = select(fl, tov.tabeVarScopep(), indexVscp);
|
||||
AstNodeExpr* const alhsp = new AstVarRef{fl, tov.varScopep(), VAccess::WRITE};
|
||||
AstNodeExpr* const arhsp = select(fl, tov.tabeVarScopep(), indexVscp);
|
||||
AstNode* outsetp = m_assignDly
|
||||
? static_cast<AstNode*>(new AstAssignDly{fl, alhsp, arhsp})
|
||||
: static_cast<AstNode*>(new AstAssign{fl, alhsp, arhsp});
|
||||
@@ -369,7 +369,7 @@ private:
|
||||
if (tov.mayBeUnassigned()) {
|
||||
V3Number outputChgMask{nodep, static_cast<int>(m_outVarps.size()), 0};
|
||||
outputChgMask.setBit(tov.ord(), 1);
|
||||
AstNode* const condp
|
||||
AstNodeExpr* const condp
|
||||
= new AstAnd{fl, select(fl, outputAssignedTableVscp, indexVscp),
|
||||
new AstConst{fl, outputChgMask}};
|
||||
outsetp = new AstIf{fl, condp, outsetp};
|
||||
|
||||
Reference in New Issue
Block a user