Fix IMPURE errors due to X-assignment temporary variables.

This commit is contained in:
Wilson Snyder
2008-07-14 10:42:58 -04:00
parent a4f3199427
commit 5771ea48ef
7 changed files with 143 additions and 5 deletions
+2 -1
View File
@@ -191,10 +191,11 @@ private:
UINFO(4," -> "<<newp<<endl);
} else {
// Make a Vxrand variable
// We use the special XTEMP type so it doesn't break pure functions
string newvarname = ((string)"__Vxrand__"
+cvtToStr(m_modp->varNumGetInc()));
AstVar* newvarp
= new AstVar (nodep->fileline(), AstVarType::MODULETEMP, newvarname,
= new AstVar (nodep->fileline(), AstVarType::XTEMP, newvarname,
new AstRange(nodep->fileline(), nodep->width()-1, 0));
m_statUnkVars++;
AstNRelinker replaceHandle;