fixed dead code

This commit is contained in:
ALEXks
2024-04-16 20:17:02 +03:00
parent 21c0c44335
commit 387707cd82
8 changed files with 15 additions and 8 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -1724,7 +1724,7 @@ static SgStatement* runConversion(SgStatement* st, SgFile* file, vector<Messages
//move label if converted
if (conv)
moveLabelBefore(st, NULL);
moveLabelBefore(st);
st->setVariant(oldVar);
return conv;

View File

@@ -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;

View File

@@ -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<std::string> getAllFilesInProject();

View File

@@ -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. Спецификаторы там тоже сохраняются, по ним в визуализаторе будет восстановлен

View File

@@ -233,7 +233,7 @@ R201 = "Приватная переменная '%s' была частично
//2019
R192 = "Удаление приватной переменной '%s' было выполнено в предположении, что выражения '%s' и '%s' различны"
//2020
R193 = "Нельзя удалить приватную переменную '%s' - более одного определения достигают оператора"
R193 = "--FREE POSITION"
//2021
R194 = "Нельзя удалить приватную переменную '%s' - не удалось найти достигающее определение для оператора"
//2022

View File

@@ -1,3 +1,3 @@
#pragma once
#define VERSION_SPF "2321"
#define VERSION_SPF "2322"