Add support for dynamic arrays, #379.

This commit is contained in:
Wilson Snyder
2020-03-07 10:24:27 -05:00
parent 8054fc47ea
commit e70cba77e6
16 changed files with 358 additions and 39 deletions
+11
View File
@@ -93,6 +93,8 @@ private:
}
else if (VN_IS(ddtypep, AssocArrayDType)) {
}
else if (VN_IS(ddtypep, DynArrayDType)) {
}
else if (VN_IS(ddtypep, QueueDType)) {
}
else if (const AstNodeUOrStructDType* adtypep = VN_CAST(ddtypep, NodeUOrStructDType)) {
@@ -260,6 +262,15 @@ private:
if (debug()>=9) newp->dumpTree(cout, "--SELBTn: ");
nodep->replaceWith(newp); VL_DO_DANGLING(pushDeletep(nodep), nodep);
}
else if (AstDynArrayDType* adtypep = VN_CAST(ddtypep, DynArrayDType)) {
// SELBIT(array, index) -> CMETHODCALL(queue, "at", index)
AstNode* subp = rhsp;
AstCMethodHard* newp = new AstCMethodHard(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); VL_DO_DANGLING(pushDeletep(nodep), nodep);
}
else if (AstQueueDType* adtypep = VN_CAST(ddtypep, QueueDType)) {
// SELBIT(array, index) -> CMETHODCALL(queue, "at", index)
AstNode* subp = rhsp;