Internals: Add range Left/Right/Lo/Hi iterable sequences (#8585)

This commit is contained in:
Geza Lore
2026-10-02 20:19:10 +01:00
committed by GitHub
parent e7abfa391b
commit 5c9a804e8b
8 changed files with 56 additions and 26 deletions
+2 -2
View File
@@ -461,7 +461,7 @@ class CoverageVisitor final : public VNVisitor {
if (const AstBasicDType* const basicp = VN_CAST(dtypep, BasicDType)) {
toggleVarBottom(above, varp, basicp->nrange());
} else if (const AstUnpackArrayDType* const adtypep = VN_CAST(dtypep, UnpackArrayDType)) {
for (int index_docs = adtypep->lo(); index_docs <= adtypep->hi(); ++index_docs) {
for (const int index_docs : adtypep->declRange().seqLoToHi()) {
const int index_code = index_docs - adtypep->lo();
ToggleEnt newent{above.m_comment + "["s + cvtToStr(index_docs) + "]",
new AstArraySel{varp->fileline(),
@@ -472,7 +472,7 @@ class CoverageVisitor final : public VNVisitor {
newent.cleanup();
}
} else if (const AstPackArrayDType* const adtypep = VN_CAST(dtypep, PackArrayDType)) {
for (int index_docs = adtypep->lo(); index_docs <= adtypep->hi(); ++index_docs) {
for (const int index_docs : adtypep->declRange().seqLoToHi()) {
const AstNodeDType* const subtypep = adtypep->subDTypep()->skipRefp();
const int index_code = index_docs - adtypep->lo();
ToggleEnt newent{above.m_comment + "["s + cvtToStr(index_docs) + "]",