delete constify call because now the pass is called after constifyAllLint().

This commit is contained in:
Yutetsu TAKATSUKASA 2020-02-16 16:02:45 +09:00
parent e77e8fe927
commit 001e26a542
No known key found for this signature in database
GPG Key ID: 8A1DD689B168385C
1 changed files with 1 additions and 15 deletions

View File

@ -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())) {