From a9ee233e34f05aae06456251cbbe8840aa19862a Mon Sep 17 00:00:00 2001 From: Grigorii Gusev Date: Wed, 29 Nov 2023 14:41:14 +0300 Subject: [PATCH] private_removing: buf fix --- .../_src/Transformations/private_removing.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/sapfor/experts/Sapfor_2017/_src/Transformations/private_removing.cpp b/sapfor/experts/Sapfor_2017/_src/Transformations/private_removing.cpp index b2215fe..7de16ad 100644 --- a/sapfor/experts/Sapfor_2017/_src/Transformations/private_removing.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Transformations/private_removing.cpp @@ -1347,18 +1347,6 @@ static SgForStmt* getScopeLoopStmt(SgStatement* stmt) return (SgForStmt*)stmt; } -static int getDimension(SgSymbol* arraySym) -{ - SgExpression* declExpr = arraySym->makeDeclExpr(); - if (declExpr == nullptr) - printInternalError(convertFileName(__FILE__).c_str(), __LINE__); - - int dimensionNum = ((SgExprListExp*)declExpr->lhs())->length(); - delete declExpr; - - return dimensionNum; -} - // findChildLoop returns LoopGraph for provided loop statement static LoopGraph* findLoop(LoopGraph* outerLoop, SgForStmt* loopStmt) { @@ -1706,7 +1694,7 @@ void removePrivatesAnalysis(vector& loopGraphs, Context context = Context{allFuncInfo, commonBlocks, messages}; context.loop = loop; context.loopStmt = loopStmt; - context.dimensionsNum = getDimension(arrayToRemove); + context.dimensionsNum = ((SgArrayType*)arrayToRemove->type())->dimension(); context.arraySymbol = arrayToRemove; auto filterMasks = checkImplicitAndIndirectUsage(&context);