diff --git a/sapfor/experts/Sapfor_2017/_src/DirectiveProcessing/directive_creator_base.cpp b/sapfor/experts/Sapfor_2017/_src/DirectiveProcessing/directive_creator_base.cpp index b9fa856..6277dd2 100644 --- a/sapfor/experts/Sapfor_2017/_src/DirectiveProcessing/directive_creator_base.cpp +++ b/sapfor/experts/Sapfor_2017/_src/DirectiveProcessing/directive_creator_base.cpp @@ -1900,7 +1900,7 @@ void selectParallelDirectiveForVariant(File* file, ParallelRegion* currParReg, moveLabelBefore(prev, loop->loop); } else if(loop->lineNum > 0) - moveLabelBefore(loop->loop, NULL); + moveLabelBefore(loop->loop); // check correctness if (loop->lineNum < 0) diff --git a/sapfor/experts/Sapfor_2017/_src/DirectiveProcessing/directive_creator_base_nodist.cpp b/sapfor/experts/Sapfor_2017/_src/DirectiveProcessing/directive_creator_base_nodist.cpp index a663b5b..f30b02d 100644 --- a/sapfor/experts/Sapfor_2017/_src/DirectiveProcessing/directive_creator_base_nodist.cpp +++ b/sapfor/experts/Sapfor_2017/_src/DirectiveProcessing/directive_creator_base_nodist.cpp @@ -135,7 +135,7 @@ void selectParallelDirectiveForVariantNoDist(File* file, ParallelRegion* currPar #if __SPF //move label before loop if(loop->lineNum > 0) - moveLabelBefore(loop->loop, NULL); + moveLabelBefore(loop->loop); // check correctness if (loop->lineNum < 0) diff --git a/sapfor/experts/Sapfor_2017/_src/Transformations/array_assign_to_loop.cpp b/sapfor/experts/Sapfor_2017/_src/Transformations/array_assign_to_loop.cpp index 07605cc..01bd012 100644 --- a/sapfor/experts/Sapfor_2017/_src/Transformations/array_assign_to_loop.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Transformations/array_assign_to_loop.cpp @@ -1724,7 +1724,7 @@ static SgStatement* runConversion(SgStatement* st, SgFile* file, vectorsetVariant(oldVar); return conv; diff --git a/sapfor/experts/Sapfor_2017/_src/Transformations/dead_code.cpp b/sapfor/experts/Sapfor_2017/_src/Transformations/dead_code.cpp index 323d30b..65cc147 100644 --- a/sapfor/experts/Sapfor_2017/_src/Transformations/dead_code.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Transformations/dead_code.cpp @@ -525,10 +525,16 @@ int removeDeadCode(SgStatement* func, rem->deleteStmt(); } else + { + moveLabelBefore(cp); cp->deleteStmt(); + } } else + { + moveLabelBefore(rem); rem->deleteStmt(); + } } countOfTransform += remove.size(); @@ -578,6 +584,7 @@ int removeDeadCode(SgStatement* func, for (auto& rem : remove) { __spf_print(PRINT_USELESS_STATEMENTS, "[Useless block statement on line %d and file %s]\n", rem->lineNumber(), rem->fileName()); + moveLabelBefore(rem); rem->deleteStmt(); if (rem == start) mainRemoved = true; diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.h b/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.h index fcf0be8..8b0257e 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.h +++ b/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.h @@ -96,7 +96,7 @@ bool isArrayType(SgType* type); bool isArrayRef(SgExpression* ex); bool isStringArrayType(SgType* type); -void moveLabelBefore(SgStatement* st, SgStatement* next); +void moveLabelBefore(SgStatement* st, SgStatement* next = NULL); bool isEqSymbols(SgSymbol* sym1, SgSymbol* sym2); std::set getAllFilesInProject(); diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/errors.h b/sapfor/experts/Sapfor_2017/_src/Utils/errors.h index 7cf30ad..179621f 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/errors.h +++ b/sapfor/experts/Sapfor_2017/_src/Utils/errors.h @@ -96,7 +96,7 @@ enum typeMessage { WARR, ERROR, NOTE }; // 17 cannot remove private var '%s' - it has recursive dependency or it depends on non-invariant var '%s' // 18 "private variable '%s' was removed" or "private variable '%s' was partially removed" // 19 "Removing of private var '%s' was made with assumption that references '%s' and '%s' are different" -// 20 "cannot remove private var '%s' - more than one definition reaches the statement" +// 20 --- FREE POSITION // 21 "cannot remove private var '%s' - cannot find reaching definition for the statement" // 22 "cannot transform ..." // 23 "cannot transform ..." @@ -276,7 +276,7 @@ static void printStackTrace() { }; } \ } while (0) -// Свободный - R205 +// Свободный - R193 и далее R205 // Гайд по русификации сообщений: При добавлении нового сообщения, меняется последний сводобный идентификатор. // В этом файле остаются только спецификаторы, для которых будет заполнен текст. Полный текст пишется в файле // russian_errors_text.txt. Спецификаторы там тоже сохраняются, по ним в визуализаторе будет восстановлен diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/russian_errors_text.txt b/sapfor/experts/Sapfor_2017/_src/Utils/russian_errors_text.txt index ef25a33..ed08dd6 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/russian_errors_text.txt +++ b/sapfor/experts/Sapfor_2017/_src/Utils/russian_errors_text.txt @@ -233,7 +233,7 @@ R201 = "Приватная переменная '%s' была частично //2019 R192 = "Удаление приватной переменной '%s' было выполнено в предположении, что выражения '%s' и '%s' различны" //2020 -R193 = "Нельзя удалить приватную переменную '%s' - более одного определения достигают оператора" +R193 = "--FREE POSITION" //2021 R194 = "Нельзя удалить приватную переменную '%s' - не удалось найти достигающее определение для оператора" //2022 diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/version.h b/sapfor/experts/Sapfor_2017/_src/Utils/version.h index ec79f72..616b105 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 "2321" +#define VERSION_SPF "2322"