Fix enums with X values. Test in next commit.

This commit is contained in:
Wilson Snyder
2013-02-02 12:43:28 -05:00
parent c9ad61b4fb
commit 91159da30d
5 changed files with 21 additions and 7 deletions
+6
View File
@@ -168,6 +168,11 @@ private:
m_constXCvt = true;
nodep->bodysp()->iterateAndNext(*this);
}
virtual void visit(AstNodeDType* nodep, AstNUser*) {
m_constXCvt = false; // Avoid loosing the X's in casex
nodep->iterateChildren(*this);
m_constXCvt = true;
}
void visitEqNeqCase(AstNodeBiop* nodep) {
UINFO(4," N/EQCASE->EQ "<<nodep<<endl);
V3Const::constifyEdit(nodep->lhsp()); // lhsp may change
@@ -283,6 +288,7 @@ private:
} else {
// Make a Vxrand variable
// We use the special XTEMP type so it doesn't break pure functions
if (!m_modp) nodep->v3fatalSrc("X number not under module");
string newvarname = ((string)"__Vxrand"
+cvtToStr(m_modp->varNumGetInc()));
AstVar* newvarp