Internal cleanups. No functional change intended

This commit is contained in:
Wilson Snyder 2020-05-23 21:57:08 -04:00
parent 3097d5e093
commit 9ffad7f0db
3 changed files with 10 additions and 13 deletions

View File

@ -2374,9 +2374,8 @@ public:
virtual AstNodeDType* skipRefToEnump() const = 0;
// (Slow) recurses - Structure alignment 1,2,4 or 8 bytes (arrays affect this)
virtual int widthAlignBytes() const = 0;
virtual int
// (Slow) recurses - Width in bytes rounding up 1,2,4,8,12,...
widthTotalBytes() const = 0;
virtual int widthTotalBytes() const = 0;
virtual bool maybePointedTo() const { return true; }
// Iff has a non-null refDTypep(), as generic node function
virtual AstNodeDType* virtRefDTypep() const { return NULL; }
@ -2533,10 +2532,8 @@ public:
virtual V3Hash sameHash() const {
return V3Hash(V3Hash(m_refDTypep), V3Hash(msb()), V3Hash(lsb()));
}
AstNodeDType* getChildDTypep() const { return childDTypep(); }
AstNodeDType* childDTypep() const {
return VN_CAST(op1p(), NodeDType);
} // op1 = Range of variable
virtual AstNodeDType* getChildDTypep() const { return childDTypep(); }
AstNodeDType* childDTypep() const { return VN_CAST(op1p(), NodeDType); }
void childDTypep(AstNodeDType* nodep) { setOp1p(nodep); }
virtual AstNodeDType* subDTypep() const { return m_refDTypep ? m_refDTypep : childDTypep(); }
void refDTypep(AstNodeDType* nodep) { m_refDTypep = nodep; }

View File

@ -7774,11 +7774,10 @@ public:
virtual bool cleanOut() const { V3ERROR_NA_RETURN(""); }
virtual int instrCount() const { return widthInstrs(); }
AstNodeDType* getChildDTypep() const { return childDTypep(); }
AstNodeDType* childDTypep() const {
return VN_CAST(op1p(), NodeDType);
} // op1 = Type assigning to
void childDTypep(AstNodeDType* nodep) { setOp1p(nodep); }
virtual AstNodeDType* subDTypep() const { return dtypep() ? dtypep() : childDTypep(); }
// op1 = Type assigning to
AstNodeDType* childDTypep() const { return VN_CAST(op1p(), NodeDType); }
void childDTypep(AstNodeDType* nodep) { setOp1p(nodep); }
AstNode* itemsp() const { return op2p(); } // op2 = AstPatReplicate, AstPatMember, etc
};
class AstPatMember : public AstNodeMath {

View File

@ -2371,9 +2371,10 @@ private:
}
virtual void visit(AstEnumDType* nodep) VL_OVERRIDE {
iterateChildren(nodep);
AstRefDType* refdtype = VN_CAST(nodep->childDTypep(), RefDType);
if (refdtype && (nodep == refdtype->refDTypep()))
refdtype->v3error("Self-referential enumerated type definition");
AstRefDType* refdtypep = VN_CAST(nodep->subDTypep(), RefDType);
if (refdtypep && (nodep == refdtypep->subDTypep())) {
refdtypep->v3error("Self-referential enumerated type definition");
}
}
virtual void visit(AstEnumItemRef* nodep) VL_OVERRIDE {
// EnumItemRef may be under a dot. Should already be resolved.