From b4a31bd292cf32ee2d62372972456a8cccd3cd87 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 1 Apr 2012 21:17:58 -0400 Subject: [PATCH] Internals: Merge AstCCast minwidth set. No functional change intended --- src/V3AstNodes.h | 5 +++-- src/V3Cast.cpp | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index 83b488311..81f1413b7 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -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) { diff --git a/src/V3Cast.cpp b/src/V3Cast.cpp index 021409bd5..e6aa583cb 100644 --- a/src/V3Cast.cpp +++ b/src/V3Cast.cpp @@ -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: "); //