Merge pull request 'private_removing: исправление багов' (#16) from private_removing into master

This commit was merged in pull request #16.
This commit is contained in:
2023-11-29 11:04:32 +00:00

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);
for (int i = 0; i < expList->length(); ++i)
if (expList->elem(i)->symbol()->identifier() == arraySym->identifier())
return ((SgExprListExp*)expList->elem(i)->lhs())->length();
return 0; int dimensionNum = ((SgExprListExp*)declExpr->lhs())->length();
delete declExpr;
return dimensionNum;
} }
// findChildLoop returns LoopGraph for provided loop statement // findChildLoop returns LoopGraph for provided loop statement