Internals: Refectoring. No functional change intended.
This commit is contained in:
parent
e673875b3b
commit
8054fc47ea
|
|
@ -2457,18 +2457,7 @@ private:
|
||||||
if (patp) {
|
if (patp) {
|
||||||
// Determine initial values
|
// Determine initial values
|
||||||
patp->dtypep(memp);
|
patp->dtypep(memp);
|
||||||
userIterate(patp, WidthVP(memp, BOTH).p()); // See visit(AstPatMember*
|
AstNode* valuep = patternMemberValueIterate(patp);
|
||||||
|
|
||||||
// Convert to concat for now
|
|
||||||
AstNode* valuep = patp->lhssp()->unlinkFrBack();
|
|
||||||
if (VN_IS(valuep, Const)) {
|
|
||||||
// Forming a AstConcat will cause problems with
|
|
||||||
// unsized (uncommitted sized) constants
|
|
||||||
if (AstNode* newccp = WidthCommitVisitor::newIfConstCommitSize(VN_CAST(valuep, Const))) {
|
|
||||||
VL_DO_DANGLING(pushDeletep(valuep), valuep);
|
|
||||||
valuep = newccp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!newp) newp = valuep;
|
if (!newp) newp = valuep;
|
||||||
else {
|
else {
|
||||||
AstConcat* concatp = new AstConcat(patp->fileline(), newp, valuep);
|
AstConcat* concatp = new AstConcat(patp->fileline(), newp, valuep);
|
||||||
|
|
@ -2511,18 +2500,7 @@ private:
|
||||||
if (patp) {
|
if (patp) {
|
||||||
// Don't want the RHS an array
|
// Don't want the RHS an array
|
||||||
patp->dtypep(arrayp->subDTypep());
|
patp->dtypep(arrayp->subDTypep());
|
||||||
// Determine values - might be another InitArray
|
AstNode* valuep = patternMemberValueIterate(patp);
|
||||||
userIterate(patp, WidthVP(patp->dtypep(), BOTH).p()); // See visit(AstPatMember*
|
|
||||||
// Convert to InitArray or constify immediately
|
|
||||||
AstNode* valuep = patp->lhssp()->unlinkFrBack();
|
|
||||||
if (VN_IS(valuep, Const)) {
|
|
||||||
// Forming a AstConcat will cause problems with
|
|
||||||
// unsized (uncommitted sized) constants
|
|
||||||
if (AstNode* newp = WidthCommitVisitor::newIfConstCommitSize(VN_CAST(valuep, Const))) {
|
|
||||||
VL_DO_DANGLING(pushDeletep(valuep), valuep);
|
|
||||||
valuep = newp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (VN_IS(arrayp, UnpackArrayDType)) {
|
if (VN_IS(arrayp, UnpackArrayDType)) {
|
||||||
if (!newp) {
|
if (!newp) {
|
||||||
AstInitArray* newap
|
AstInitArray* newap
|
||||||
|
|
@ -2575,21 +2553,8 @@ private:
|
||||||
if (patp) {
|
if (patp) {
|
||||||
// Determine initial values
|
// Determine initial values
|
||||||
vdtypep = nodep->findLogicBoolDType();
|
vdtypep = nodep->findLogicBoolDType();
|
||||||
// Don't want the RHS an array
|
|
||||||
patp->dtypep(vdtypep);
|
patp->dtypep(vdtypep);
|
||||||
// Determine values - might be another InitArray
|
AstNode* valuep = patternMemberValueIterate(patp);
|
||||||
userIterate(patp, WidthVP(patp->dtypep(), BOTH).p());
|
|
||||||
// Convert to InitArray or constify immediately
|
|
||||||
AstNode* valuep = patp->lhssp()->unlinkFrBack();
|
|
||||||
if (VN_IS(valuep, Const)) {
|
|
||||||
// Forming a AstConcat will cause problems with
|
|
||||||
// unsized (uncommitted sized) constants
|
|
||||||
if (AstNode* newccp
|
|
||||||
= WidthCommitVisitor::newIfConstCommitSize(VN_CAST(valuep, Const))) {
|
|
||||||
VL_DO_DANGLING(pushDeletep(valuep), valuep);
|
|
||||||
valuep = newccp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{ // Packed. Convert to concat for now.
|
{ // Packed. Convert to concat for now.
|
||||||
if (!newp) newp = valuep;
|
if (!newp) newp = valuep;
|
||||||
else {
|
else {
|
||||||
|
|
@ -2609,6 +2574,22 @@ private:
|
||||||
//if (debug()>=9) newp->dumpTree("-apat-out: ");
|
//if (debug()>=9) newp->dumpTree("-apat-out: ");
|
||||||
VL_DO_DANGLING(pushDeletep(nodep), nodep); // Deletes defaultp also, if present
|
VL_DO_DANGLING(pushDeletep(nodep), nodep); // Deletes defaultp also, if present
|
||||||
}
|
}
|
||||||
|
AstNode* patternMemberValueIterate(AstPatMember* patp) {
|
||||||
|
// Determine values - might be another InitArray
|
||||||
|
userIterate(patp, WidthVP(patp->dtypep(), BOTH).p());
|
||||||
|
// Convert to InitArray or constify immediately
|
||||||
|
AstNode* valuep = patp->lhssp()->unlinkFrBack();
|
||||||
|
if (VN_IS(valuep, Const)) {
|
||||||
|
// Forming a AstConcat will cause problems with
|
||||||
|
// unsized (uncommitted sized) constants
|
||||||
|
if (AstNode* newp = WidthCommitVisitor::newIfConstCommitSize(VN_CAST(valuep, Const))) {
|
||||||
|
VL_DO_DANGLING(pushDeletep(valuep), valuep);
|
||||||
|
valuep = newp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return valuep;
|
||||||
|
}
|
||||||
|
|
||||||
virtual void visit(AstPatMember* nodep) VL_OVERRIDE {
|
virtual void visit(AstPatMember* nodep) VL_OVERRIDE {
|
||||||
AstNodeDType* vdtypep = m_vup->dtypeNullp();
|
AstNodeDType* vdtypep = m_vup->dtypeNullp();
|
||||||
UASSERT_OBJ(vdtypep, nodep, "Pattern member type not assigned by AstPattern visitor");
|
UASSERT_OBJ(vdtypep, nodep, "Pattern member type not assigned by AstPattern visitor");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue