first step of shadow fixing

This commit is contained in:
ALEXks
2025-02-20 19:52:32 +03:00
committed by Dudarenko
parent 68d2f3253c
commit 26fe1d3f61
11 changed files with 240 additions and 217 deletions

View File

@@ -509,6 +509,22 @@ static vector<PrevNode> getPrev(ShadowNode* curr, const map<string, vector<FuncI
static bool isMoveValid(ShadowNode* moveTo, DIST::Array* array, const set<ShadowNode*>& allShadowNodes)
{
if (array->GetLocation().first == DIST::l_MODULE)
{
auto func = moveTo->location.first->funcPointer;
bool checkOk = true;
try {
array->GetNameInLocationS(moveTo->location.first->funcPointer);
}
catch (...) {
checkOk = false;
}
if (!checkOk)
return false;
}
//check added
for (auto& elem : moveTo->newShadows)
if (elem.first == array)
@@ -779,8 +795,6 @@ static void replacingShadowNodes(FuncInfo* currF)
if (currSh.second.size() == 0)
continue;
const ShadowElement& currElement = currSh.second[0];
SgSymbol* s = (SgSymbol*)currArray->GetNameInLocationS(currF->funcPointer);

View File

@@ -105,7 +105,7 @@ void Sleep(int millisec) { usleep(millisec * 2000); }
*/
#define SERV "[SERVER]"
static const char* VERSION = "10";
static const char* VERSION = "11";
static FILE* logFile = NULL;
extern void __bst_create(const char* name);
@@ -586,7 +586,7 @@ int main(int argc, char** argv)
javaPort = getPort(serverJAVA);
__print_log(logFile, "done with port %d", javaPort);
__print(SERV, "SOCKET PORT for SAPFOR %d, SOCKET PORT for Visualizer %d", sapforPort, javaPort);
printf("SOCKET PORT for SAPFOR %d, SOCKET PORT for Visualizer %d\n", sapforPort, javaPort);
const int maxSize = 4096;
char* buf = new char[maxSize + 1];

View File

@@ -331,8 +331,10 @@ SgSymbol* getNameInLocation(SgStatement* func, const string& varName, const stri
if (altNames.size() > 0)
return altNames.begin()->second;
else
else {
__spf_print(1, "%s %s %s\n", func->symbol()->identifier(), varName.c_str(), locName.c_str());
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
}
return NULL;
}

View File

@@ -1,3 +1,3 @@
#pragma once
#define VERSION_SPF "2392"
#define VERSION_SPF "2393"