Internals: Merge AstCCast minwidth set. No functional change intended

This commit is contained in:
Wilson Snyder 2012-04-01 21:17:58 -04:00
parent cc1adf9b38
commit b4a31bd292
2 changed files with 4 additions and 4 deletions

View File

@ -2882,10 +2882,11 @@ struct AstCCast : public AstNodeUniop {
private:
int m_size;
public:
AstCCast(FileLine* fl, AstNode* lhsp, int setwidth) : AstNodeUniop(fl, lhsp) {
AstCCast(FileLine* fl, AstNode* lhsp, int setwidth, int minwidth=-1) : AstNodeUniop(fl, lhsp) {
m_size=setwidth;
if (setwidth) {
dtypeSetLogicSized(setwidth,setwidth,AstNumeric::UNSIGNED);
if (minwidth==-1) minwidth=setwidth;
dtypeSetLogicSized(setwidth,minwidth,AstNumeric::UNSIGNED);
}
}
AstCCast(FileLine* fl, AstNode* lhsp, AstNode* typeFromp) : AstNodeUniop(fl, lhsp) {

View File

@ -77,8 +77,7 @@ private:
AstNRelinker relinkHandle;
nodep->unlinkFrBack(&relinkHandle);
//
AstCCast* castp = new AstCCast (nodep->fileline(), nodep, needsize);
castp->width(needsize, nodep->widthMin());
AstCCast* castp = new AstCCast (nodep->fileline(), nodep, needsize, nodep->widthMin());
relinkHandle.relink(castp);
//if (debug()>8) castp->dumpTree(cout,"-castins: ");
//