Internals: Prep for V3Slice rewrite. No functional change intended.

This commit is contained in:
Wilson Snyder 2017-10-04 21:15:19 -04:00
parent 77a3d683e3
commit b532a47e4a
4 changed files with 7 additions and 2 deletions

View File

@ -1458,6 +1458,7 @@ public:
virtual bool sizeMattersLhs() { return false; } virtual bool sizeMattersRhs() { return false; }
virtual bool sizeMattersThs() { return false; }
virtual int instrCount() const { return instrCountBranch(); }
virtual AstNode* cloneType(AstNode* condp, AstNode* expr1p, AstNode* expr2p) = 0;
};
class AstNodePreSel : public AstNode {

View File

@ -2183,6 +2183,8 @@ public:
AstCond(FileLine* fl, AstNode* condp, AstNode* expr1p, AstNode* expr2p)
: AstNodeCond(fl, condp, expr1p, expr2p) {}
ASTNODE_NODE_FUNCS(Cond)
virtual AstNode* cloneType(AstNode* condp, AstNode* expr1p, AstNode* expr2p) {
return new AstCond(this->fileline(), condp, expr1p, expr2p); }
};
class AstCondBound : public AstNodeCond {
@ -2193,6 +2195,8 @@ public:
AstCondBound(FileLine* fl, AstNode* condp, AstNode* expr1p, AstNode* expr2p)
: AstNodeCond(fl, condp, expr1p, expr2p) {}
ASTNODE_NODE_FUNCS(CondBound)
virtual AstNode* cloneType(AstNode* condp, AstNode* expr1p, AstNode* expr2p) {
return new AstCondBound(this->fileline(), condp, expr1p, expr2p); }
};
class AstCoverDecl : public AstNodeStmt {

View File

@ -195,7 +195,7 @@ private:
arrayselp = lhsp->castArraySel();
}
if (!arrayselp) nodep->v3fatalSrc("No arraysel under bitsel?");
if (arrayselp->length()!=1) nodep->v3fatalSrc("ArraySel with length!=1 should have been removed in V3Slice");
if (arrayselp->dtypep()->skipRefp()->castUnpackArrayDType()) nodep->v3fatalSrc("ArraySel with unpacked arrays should have been removed in V3Slice");
UINFO(4,"AssignDlyArray: "<<nodep<<endl);
//

View File

@ -243,7 +243,7 @@ private:
}
bool expandWide (AstNodeAssign* nodep, AstArraySel* rhsp) {
UINFO(8," Wordize ASSIGN(ARRAYSEL) "<<nodep<<endl);
if (rhsp->length()!=1) nodep->v3fatalSrc("ArraySel with length!=1 should have been removed in V3Slice");
if (nodep->dtypep()->skipRefp()->castUnpackArrayDType()) nodep->v3fatalSrc("ArraySel with unpacked arrays should have been removed in V3Slice");
for (int w=0; w<nodep->widthWords(); w++) {
addWordAssign(nodep, w, newAstWordSelClone (rhsp, w));
}