From 0985b827604b382c345b5376a94dfb393bff77c2 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 13 Jan 2013 09:48:12 -0500 Subject: [PATCH] Commentary --- src/V3AstNodes.cpp | 4 +++- src/V3AstNodes.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp index cc2d06e52..145efe847 100644 --- a/src/V3AstNodes.cpp +++ b/src/V3AstNodes.cpp @@ -307,6 +307,8 @@ AstNodeDType* AstNodeDType::dtypeDimensionp(int dimension) { // DECL: VAR a (ARRAYSEL0 (ARRAYSEL1 (ARRAYSEL2 (DT RANGE3)))) // *or* VAR a (ARRAYSEL0 (ARRAYSEL1 (ARRAYSEL2 (ARRAYSEL3 (DT)))) // SEL1 needs to select from entire variable which is a pointer to ARRAYSEL0 + // TODO this function should be removed in favor of recursing the dtype(), + // as that allows for more complicated data types. int dim = 0; for (AstNodeDType* dtypep=this; dtypep; ) { dtypep = dtypep->skipRefp(); // Skip AstRefDType/AstTypedef, or return same node @@ -403,7 +405,7 @@ AstNode* AstArraySel::baseFromp(AstNode* nodep) { ///< What is the base variable while (nodep) { if (nodep->castArraySel()) { nodep=nodep->castArraySel()->fromp(); continue; } else if (nodep->castSel()) { nodep=nodep->castSel()->fromp(); continue; } - // AstNodeSelPre stashes the associated variable under a ATTROF of AstAttrType::VAR_BASE/MEMBER_BASE so it isn't constified + // AstNodeSelPre stashes the associated variable under an ATTROF of AstAttrType::VAR_BASE/MEMBER_BASE so it isn't constified else if (nodep->castAttrOf()) { nodep=nodep->castAttrOf()->fromp(); continue; } else if (nodep->castNodePreSel()) { if (nodep->castNodePreSel()->attrp()) { diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index 1830aece3..d0382fe03 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -716,6 +716,8 @@ struct AstSel : public AstNodeTriop { // Multiple bit range extraction // Parents: math|stmt // Children: varref|arraysel, math, constant math + // Tempting to have an lvalue() style method here as LHS selects are quite + // different, but that doesn't play well with V3Inst and bidirects which don't know direction AstSel(FileLine* fl, AstNode* fromp, AstNode* lsbp, AstNode* widthp) :AstNodeTriop(fl, fromp, lsbp, widthp) { if (widthp->castConst()) {