For generated variables, opt towards 2-state so zero init

This commit is contained in:
Wilson Snyder
2012-01-26 08:29:55 -05:00
parent af9e85bda1
commit 8f40d6617e
7 changed files with 21 additions and 7 deletions
+2 -2
View File
@@ -133,8 +133,8 @@ private:
if (width==0) {
varp = new AstVar (oldvarscp->fileline(), AstVarType::BLOCKTEMP, name, oldvarscp->varp());
varp->widthSignedFrom(oldvarscp);
} else {
varp = new AstVar (oldvarscp->fileline(), AstVarType::BLOCKTEMP, name, AstLogicPacked(), width);
} else { // Used for vset and dimensions, so can zero init
varp = new AstVar (oldvarscp->fileline(), AstVarType::BLOCKTEMP, name, AstBitPacked(), width);
}
addmodp->addStmtp(varp);
m_modVarMap.insert(make_pair(make_pair(addmodp, name), varp));