Internals: Rename AstVar::initp to valuep as it's a constant, not initial value

This commit is contained in:
Wilson Snyder
2010-01-21 18:20:47 -05:00
parent e4f1e5f4c3
commit 2da9d46ca6
11 changed files with 63 additions and 63 deletions
+3 -3
View File
@@ -278,7 +278,7 @@ void ParamVisitor::visit(AstCell* nodep, AstNUser*) {
pinp->v3error("Attempted parameter setting of non-parameter: Param "<<pinp->name()<<" of "<<nodep->prettyName());
} else {
AstConst* constp = pinp->exprp()->castConst();
AstConst* origconstp = modvarp->initp()->castConst();
AstConst* origconstp = modvarp->valuep()->castConst();
if (!constp) {
//if (debug()) pinp->dumpTree(cout,"error:");
pinp->v3error("Can't convert defparam value to constant: Param "<<pinp->name()<<" of "<<nodep->prettyName());
@@ -352,9 +352,9 @@ void ParamVisitor::visit(AstCell* nodep, AstNUser*) {
if (modvarp) {
AstConst* constp = pinp->exprp()->castConst();
// Remove any existing parameter
if (modvarp->initp()) modvarp->initp()->unlinkFrBack()->deleteTree();
if (modvarp->valuep()) modvarp->valuep()->unlinkFrBack()->deleteTree();
// Set this parameter to value requested by cell
modvarp->initp(constp->cloneTree(false));
modvarp->valuep(constp->cloneTree(false));
}
}
} else {