Internals: Tree dump DEFAULT pattern. No functional change.

This commit is contained in:
Wilson Snyder 2020-11-07 11:56:24 -05:00
parent 602750b1ee
commit ff5465308b
3 changed files with 8 additions and 3 deletions

View File

@ -1373,6 +1373,10 @@ void AstPackageImport::dump(std::ostream& str) const {
this->AstNode::dump(str);
str << " -> " << packagep();
}
void AstPatMember::dump(std::ostream& str) const {
this->AstNode::dump(str);
if (isDefault()) str << " [DEFAULT]";
}
void AstNodeTriop::dump(std::ostream& str) const { this->AstNodeMath::dump(str); }
void AstSel::dump(std::ostream& str) const {
this->AstNodeTriop::dump(str);

View File

@ -8386,6 +8386,7 @@ public:
virtual string emitSimpleOperator() override { V3ERROR_NA_RETURN(""); }
virtual bool cleanOut() const override { V3ERROR_NA_RETURN(""); }
virtual int instrCount() const override { return widthInstrs() * 2; }
virtual void dump(std::ostream& str = std::cout) const override;
// op1 = expression to assign or another AstPattern (list if replicated)
AstNode* lhssp() const { return op1p(); }
AstNode* keyp() const { return op2p(); } // op2 = assignment key (Const, id Text)

View File

@ -3294,7 +3294,7 @@ private:
nodep->dtypep()->numeric());
}
}
if (newpatp) { VL_DO_DANGLING(pushDeletep(newpatp), newpatp); }
if (newpatp) VL_DO_DANGLING(pushDeletep(newpatp), newpatp);
}
if (newp) {
nodep->replaceWith(newp);
@ -3347,7 +3347,7 @@ private:
}
}
}
if (newpatp) { VL_DO_DANGLING(pushDeletep(newpatp), newpatp); }
if (newpatp) VL_DO_DANGLING(pushDeletep(newpatp), newpatp);
}
if (!patmap.empty()) nodep->v3error("Assignment pattern with too many elements");
if (newp) {
@ -3444,7 +3444,7 @@ private:
}
}
}
if (newpatp) { VL_DO_DANGLING(pushDeletep(newpatp), newpatp); }
if (newpatp) VL_DO_DANGLING(pushDeletep(newpatp), newpatp);
}
if (!patmap.empty()) nodep->v3error("Assignment pattern with too many elements");
if (newp) {