private_removing: bug fixes

This commit is contained in:
2023-11-29 13:45:27 +03:00
parent 0c29d54f83
commit 5b34551310

View File

@@ -433,9 +433,8 @@ static void fillReadShortFixedSumscripts(SgExpression* exp, const PrivateToRemov
{ {
auto subscripts = getShortFixedSubscriptsVector((SgArrayRefExp*)exp, var.fixedDimensions); auto subscripts = getShortFixedSubscriptsVector((SgArrayRefExp*)exp, var.fixedDimensions);
fixedSubscripts.insert(subscripts); fixedSubscripts.insert(subscripts);
return;
} }
return;
} }
fillReadShortFixedSumscripts(exp->lhs(), var, fixedSubscripts); fillReadShortFixedSumscripts(exp->lhs(), var, fixedSubscripts);
@@ -1350,16 +1349,14 @@ static SgForStmt* getScopeLoopStmt(SgStatement* stmt)
static int getDimension(SgSymbol* arraySym) static int getDimension(SgSymbol* arraySym)
{ {
SgStatement* declarationStmt = arraySym->declaredInStmt(); SgExpression* declExpr = arraySym->makeDeclExpr();
if (declarationStmt == nullptr) if (declExpr == nullptr)
return 0; printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
SgExprListExp* expList = (SgExprListExp*)declarationStmt->expr(0); int dimensionNum = ((SgExprListExp*)declExpr->lhs())->length();
for (int i = 0; i < expList->length(); ++i) delete declExpr;
if (expList->elem(i)->symbol()->identifier() == arraySym->identifier())
return ((SgExprListExp*)expList->elem(i)->lhs())->length();
return 0; return dimensionNum;
} }
// findChildLoop returns LoopGraph for provided loop statement // findChildLoop returns LoopGraph for provided loop statement