From 001e26a542966f2e2121140ba7a540b5e399cc5d Mon Sep 17 00:00:00 2001 From: Yutetsu TAKATSUKASA Date: Sun, 16 Feb 2020 16:02:45 +0900 Subject: [PATCH] delete constify call because now the pass is called after constifyAllLint(). --- src/V3SplitVar.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/V3SplitVar.cpp b/src/V3SplitVar.cpp index 73c617f89..5ee82a8e5 100644 --- a/src/V3SplitVar.cpp +++ b/src/V3SplitVar.cpp @@ -332,18 +332,6 @@ class SplitUnpackedVarVisitor : public AstNVisitor { } return NULL; } - // This visitor is used before V3Const::constifyAllLint(), - // some parameters need to be resolved here, but don't abuse this function. - static AstConst* constifyIfNot(AstNode* nodep) { - AstConst* constp = VN_CAST(nodep, Const); - if (!constp) { - UINFO(6, nodep << " is expected to be constant, but not\n"); - AstNode* constified = V3Const::constifyEdit(nodep); - UINFO(6, "After constified:" << constified << '\n'); - constp = VN_CAST(constified, Const); - } - return constp; - } static int outerMostSizeOfUnpackedArray(AstVar* nodep) { AstUnpackArrayDType* dtypep = VN_CAST(nodep->dtypep()->skipRefp(), UnpackArrayDType); UASSERT_OBJ(dtypep, nodep, "Must be unapcked array"); @@ -451,9 +439,7 @@ class SplitUnpackedVarVisitor : public AstNVisitor { } virtual void visit(AstArraySel* nodep) VL_OVERRIDE { if (AstVarRef* refp = isTargetVref(nodep->fromp())) { - // nodep->bitp() is sometimes AstSel which consists of AstAdd/Sub and parameters. - // constify can solve it. - AstConst* indexp = constifyIfNot(nodep->bitp()); + AstConst* indexp = VN_CAST(nodep->bitp(), Const); if (indexp) { // OK UINFO(4, "add " << nodep << " for " << refp->varp()->prettyName() << "\n"); if (indexp->toUInt() < outerMostSizeOfUnpackedArray(refp->varp())) {