Support queues (excluding {} notation and pattern assignments), bug545.

This commit is contained in:
Wilson Snyder
2019-12-01 12:35:49 -05:00
parent b81295230a
commit e28175108f
19 changed files with 574 additions and 10 deletions
+11
View File
@@ -93,6 +93,8 @@ private:
}
else if (const AstAssocArrayDType* adtypep = VN_CAST(ddtypep, AssocArrayDType)) {
}
else if (const AstQueueDType* adtypep = VN_CAST(ddtypep, QueueDType)) {
}
else if (const AstNodeClassDType* adtypep = VN_CAST(ddtypep, NodeClassDType)) {
fromRange = adtypep->declRange();
}
@@ -257,6 +259,15 @@ private:
if (debug()>=9) newp->dumpTree(cout, "--SELBTn: ");
nodep->replaceWith(newp); pushDeletep(nodep); VL_DANGLING(nodep);
}
else if (AstQueueDType* adtypep = VN_CAST(ddtypep, QueueDType)) {
// SELBIT(array, index) -> CMETHODCALL(queue, "at", index)
AstNode* subp = rhsp;
AstCMethodCall* newp = new AstCMethodCall(nodep->fileline(),
fromp, "at", subp);
newp->dtypeFrom(adtypep->subDTypep()); // Need to strip off queue reference
if (debug()>=9) newp->dumpTree(cout, "--SELBTq: ");
nodep->replaceWith(newp); pushDeletep(nodep); VL_DANGLING(nodep);
}
else if (VN_IS(ddtypep, BasicDType)) {
// SELBIT(range, index) -> SEL(array, index, 1)
AstSel* newp = new AstSel(nodep->fileline(),