From 1b4eb0c5c4eee630c70e0562893a3891bc17c4e5 Mon Sep 17 00:00:00 2001 From: ALEXks Date: Tue, 9 Apr 2024 11:51:21 +0300 Subject: [PATCH] fixed CalculateInteger usage --- sapfor/experts/Sapfor_2017/_src/GraphCall/graph_calls.cpp | 2 +- sapfor/experts/Sapfor_2017/_src/Inliner/inliner.cpp | 6 +++--- .../Sapfor_2017/_src/LoopAnalyzer/loop_analyzer.cpp | 4 ++-- .../_src/ParallelizationRegions/ParRegions.cpp | 2 +- .../ParallelizationRegions/resolve_par_reg_conflicts.cpp | 2 +- .../Sapfor_2017/_src/Transformations/loops_combiner.cpp | 8 ++++---- sapfor/experts/Sapfor_2017/_src/Utils/version.h | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sapfor/experts/Sapfor_2017/_src/GraphCall/graph_calls.cpp b/sapfor/experts/Sapfor_2017/_src/GraphCall/graph_calls.cpp index c26682a..74ddd52 100644 --- a/sapfor/experts/Sapfor_2017/_src/GraphCall/graph_calls.cpp +++ b/sapfor/experts/Sapfor_2017/_src/GraphCall/graph_calls.cpp @@ -328,7 +328,7 @@ static void processActualParams(SgExpression *parList, const maplhs()); + SgExpression* result = CalculateInteger(ex->lhs()->copyPtr()); if (result != ex->lhs()) { currParams.parameters[num] = new int[1]; diff --git a/sapfor/experts/Sapfor_2017/_src/Inliner/inliner.cpp b/sapfor/experts/Sapfor_2017/_src/Inliner/inliner.cpp index 4e1c584..c97531c 100644 --- a/sapfor/experts/Sapfor_2017/_src/Inliner/inliner.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Inliner/inliner.cpp @@ -2320,20 +2320,20 @@ static void createDeclarations(const map>& newSymbs if (t->selector()) { if (t->selector()->variant() == CONST_REF) - t->setSelector(CalculateInteger(t->selector())); + t->setSelector(CalculateInteger(t->selector()->copyPtr())); } if (t->length()) { if (t->length()->variant() == CONST_REF) { - auto result = CalculateInteger(t->length()); + auto result = CalculateInteger(t->length()->copyPtr()); if (result->variant() == INT_VAL) t->setLength(result); } } } - auto result = CalculateInteger(list->lhs()); + auto result = CalculateInteger(list->lhs()->copyPtr()); list->setLhs(result); } list = list->rhs(); diff --git a/sapfor/experts/Sapfor_2017/_src/LoopAnalyzer/loop_analyzer.cpp b/sapfor/experts/Sapfor_2017/_src/LoopAnalyzer/loop_analyzer.cpp index 8807af9..fa4476d 100644 --- a/sapfor/experts/Sapfor_2017/_src/LoopAnalyzer/loop_analyzer.cpp +++ b/sapfor/experts/Sapfor_2017/_src/LoopAnalyzer/loop_analyzer.cpp @@ -2559,9 +2559,9 @@ SgExpression* getTypeLengthExpr(SgType *t) if (!len && !selector) //the number of bytes is not specified in type declaration statement return (new SgValueExp(getIntrinsicTypeSize(t))); else if (len && !selector) //INTEGER*2,REAL*8,CHARACTER*(N+1) - return CalculateInteger(len); + return CalculateInteger(len->copyPtr()); else - return CalculateInteger(getLengthOfKindExpr(t, selector, len)); //specified kind or/and len + return CalculateInteger(getLengthOfKindExpr(t, selector, len)->copyPtr()); //specified kind or/and len } int getSizeOfType(SgType *t) diff --git a/sapfor/experts/Sapfor_2017/_src/ParallelizationRegions/ParRegions.cpp b/sapfor/experts/Sapfor_2017/_src/ParallelizationRegions/ParRegions.cpp index 5f6c522..d22d115 100644 --- a/sapfor/experts/Sapfor_2017/_src/ParallelizationRegions/ParRegions.cpp +++ b/sapfor/experts/Sapfor_2017/_src/ParallelizationRegions/ParRegions.cpp @@ -631,7 +631,7 @@ int printParalleRegions(const char *fileName, vector ®ions) static int getIntVal(SgExpression *ex) { - SgExpression* calc = CalculateInteger(ex); + SgExpression* calc = CalculateInteger(ex->copyPtr()); if (calc->variant() == INT_VAL) return calc->valueInteger(); else diff --git a/sapfor/experts/Sapfor_2017/_src/ParallelizationRegions/resolve_par_reg_conflicts.cpp b/sapfor/experts/Sapfor_2017/_src/ParallelizationRegions/resolve_par_reg_conflicts.cpp index d848895..4df11ec 100644 --- a/sapfor/experts/Sapfor_2017/_src/ParallelizationRegions/resolve_par_reg_conflicts.cpp +++ b/sapfor/experts/Sapfor_2017/_src/ParallelizationRegions/resolve_par_reg_conflicts.cpp @@ -114,7 +114,7 @@ static string getStringDeclaration(SgSymbol *symb) if (SgFile::switchToFile(symb->getFile()->filename()) != -1) { auto stat = symb->makeVarDeclStmt(); - auto res = CalculateInteger(stat->expr(0)); + auto res = CalculateInteger(stat->expr(0)->copyPtr()); stat->setExpression(0, res); decl = stat->unparse(); } diff --git a/sapfor/experts/Sapfor_2017/_src/Transformations/loops_combiner.cpp b/sapfor/experts/Sapfor_2017/_src/Transformations/loops_combiner.cpp index 87db942..ae5db2e 100644 --- a/sapfor/experts/Sapfor_2017/_src/Transformations/loops_combiner.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Transformations/loops_combiner.cpp @@ -131,13 +131,13 @@ static bool isEqExpressions(SgExpression* exp1, SgExpression* exp2) if (exp1 != NULL) { - exp1 = CalculateInteger(exp1); + exp1 = CalculateInteger(exp1->copyPtr()); str1 = exp1->unparse(); } if (exp2 != NULL) { - exp2 = CalculateInteger(exp2); + exp2 = CalculateInteger(exp2->copyPtr()); str2 = exp2->unparse(); } @@ -150,8 +150,8 @@ static bool isOppositeExpressions(SgExpression* exp1, SgExpression* exp2) if (exp1 == NULL || exp2 == NULL) return false; - exp1 = CalculateInteger(exp1); - exp2 = CalculateInteger(exp2); + exp1 = CalculateInteger(exp1->copyPtr()); + exp2 = CalculateInteger(exp2->copyPtr()); if (exp1->variant() == MINUS_OP) return isEqExpressions(exp1->lhs(), exp2); diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/version.h b/sapfor/experts/Sapfor_2017/_src/Utils/version.h index a6f02c2..0cfc91a 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/version.h +++ b/sapfor/experts/Sapfor_2017/_src/Utils/version.h @@ -1,3 +1,3 @@ #pragma once -#define VERSION_SPF "2307" +#define VERSION_SPF "2308"