5 Commits

Author SHA1 Message Date
ALEXks
309fc575d5 fixed AlignRuleBase::toJson() 2025-05-18 15:12:59 +03:00
ALEXks
4b24d19d5b fixed Array::toJson() 2025-05-18 15:09:30 +03:00
ALEXks
6bf8e54d78 version updated 2025-05-18 15:09:30 +03:00
ALEXks
df0a89ffd5 added json for SPF_GetArrayDistribution pass 2025-05-18 15:09:30 +03:00
ALEXks
f66a100e68 added json for SPF_GetAllDeclaratedArrays pass 2025-05-18 15:09:30 +03:00
5 changed files with 24 additions and 30 deletions

View File

@@ -1601,7 +1601,7 @@ static bool matchParallelAndDist(const pair<DIST::Array*, const DistrVariant*>&
parallelOn = NULL; parallelOn = NULL;
for (auto& refOn : realRefs) for (auto& refOn : realRefs)
{ {
linkWithTempl = refOn->GetLinksWithTemplate(regionId); linkWithTempl = parallelOn->GetLinksWithTemplate(regionId);
int z = 0; int z = 0;
for (int k = 0; k < linkWithTempl.size(); ++k) for (int k = 0; k < linkWithTempl.size(); ++k)
if (linkWithTempl[k] != -1) if (linkWithTempl[k] != -1)

View File

@@ -331,8 +331,7 @@ static string unparseProjectIfNeed(SgFile* file, const int curr_regime, const bo
unparseToBuf = removeIncludeStatsAndUnparse(file, file_name, fout_name.c_str(), allIncludeFiles, out_free_form == 1, moduleUsesByFile, unparseToBuf = removeIncludeStatsAndUnparse(file, file_name, fout_name.c_str(), allIncludeFiles, out_free_form == 1, moduleUsesByFile,
moduleDecls, getObjectForFileFromMap(file_name, exctactedModuleStats), toString, false, true); moduleDecls, getObjectForFileFromMap(file_name, exctactedModuleStats), toString, false, true);
auto itI = filesToInclude.find(file_name); auto itI = filesToInclude.find(file_name);
for (auto& [_, incls] : itI->second) for (auto& [_, incl] : itI->second)
for (auto& incl : incls)
if (allIncludeFiles.find(incl) != allIncludeFiles.end()) if (allIncludeFiles.find(incl) != allIncludeFiles.end())
allIncludeFiles.erase(incl); allIncludeFiles.erase(incl);
} }
@@ -828,7 +827,7 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne
{ {
auto fileIt = includeDependencies.find(file_name); auto fileIt = includeDependencies.find(file_name);
if (fileIt == includeDependencies.end()) if (fileIt == includeDependencies.end())
fileIt = includeDependencies.insert(fileIt, make_pair(file_name, map<int, set<string>>())); fileIt = includeDependencies.insert(fileIt, make_pair(file_name, vector<pair<int, string>>()));
set<string> modFiles; set<string> modFiles;
for (auto& elem : moduleDecls) for (auto& elem : moduleDecls)
@@ -845,7 +844,7 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne
{ {
if (lastFromFile == NULL) if (lastFromFile == NULL)
printInternalError(convertFileName(__FILE__).c_str(), __LINE__); printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
fileIt->second[lastFromFile->lineNumber()].insert(st->fileName()); fileIt->second.push_back(make_pair(lastFromFile->lineNumber(), st->fileName()));
} }
else else
lastFromFile = st; lastFromFile = st;
@@ -1604,17 +1603,14 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne
set<string> includedToThisFile; set<string> includedToThisFile;
if (itDep != includeDependencies.end()) if (itDep != includeDependencies.end())
{ {
for (auto& [_, incls] : itDep->second) for (auto& [_, incl] : itDep->second)
{
for (auto& incl : incls)
{ {
auto comm = commentsToInclude.find(incl); auto comm = commentsToInclude.find(incl);
if (comm != commentsToInclude.end()) if (comm != commentsToInclude.end())
for (auto& allComm : comm->second) for (auto &allComm : comm->second)
includedToThisFile.insert(allComm.second.begin(), allComm.second.end()); includedToThisFile.insert(allComm.second.begin(), allComm.second.end());
} }
} }
}
for (int z = 0; z < parallelRegions.size(); ++z) for (int z = 0; z < parallelRegions.size(); ++z)
{ {

View File

@@ -85,7 +85,7 @@ std::map<std::string, std::map<int, std::set<std::string>>> commentsToInclude;
// //
//for INSERT_INCLUDES //for INSERT_INCLUDES
std::map<std::string, std::map<int, std::set<std::string>>> filesToInclude; // file -> includes [nearest line, include] std::map<std::string, std::vector<std::pair<int, std::string>>> filesToInclude; // file -> includes [nearest line, include]
// //
//for PASSES DEPENDENSIES //for PASSES DEPENDENSIES
@@ -96,7 +96,7 @@ std::set<passes> passesIgnoreStateDone;
//for files info //for files info
std::map<std::string, int> lineInfo; // file -> lines count std::map<std::string, int> lineInfo; // file -> lines count
std::map<std::string, std::pair<std::set<int>, std::set<int>>> dirsInfo; // file -> dirs <lines SPF, lines DVM> count std::map<std::string, std::pair<std::set<int>, std::set<int>>> dirsInfo; // file -> dirs <lines SPF, lines DVM> count
std::map<std::string, std::map<int, std::set<std::string>>> includeDependencies; // file -> includes [nearest line, include] std::map<std::string, std::vector<std::pair<int, std::string>>> includeDependencies; // file -> includes [nearest line, include]
std::vector<std::string> filesCompilationOrder; // order of files for unite to one file std::vector<std::string> filesCompilationOrder; // order of files for unite to one file
std::map<std::string, std::map<SgStatement*, std::vector<SgStatement*>>> exctactedModuleStats; // file -> hided excluded modules std::map<std::string, std::map<SgStatement*, std::vector<SgStatement*>>> exctactedModuleStats; // file -> hided excluded modules
// //

View File

@@ -1,3 +1,3 @@
#pragma once #pragma once
#define VERSION_SPF "2420" #define VERSION_SPF "2418"

View File

@@ -1310,7 +1310,7 @@ int SPF_GetIntrinsics(void*& context, short *&result)
return (int)resVal.size() + 1; return (int)resVal.size() + 1;
} }
extern map<string, map<int, set<string>>> includeDependencies; extern map<string, vector<pair<int, string>>> includeDependencies;
int SPF_GetIncludeDependencies(void*& context, int winHandler, short *options, short *projName, short *&result, short*& output, int*& outputSize, int SPF_GetIncludeDependencies(void*& context, int winHandler, short *options, short *projName, short *&result, short*& output, int*& outputSize,
short*& outputMessage, int*& outputMessageSize) short*& outputMessage, int*& outputMessageSize)
{ {
@@ -1330,16 +1330,13 @@ int SPF_GetIncludeDependencies(void*& context, int winHandler, short *options, s
includes["file"] = deps.first; includes["file"] = deps.first;
json array = json::array(); json array = json::array();
for (const auto& [line, incls] : deps.second) for (const auto& [line, incl] : deps.second)
{
for (auto& incl : incls)
{ {
json elem; json elem;
elem["line"] = line; elem["line"] = line;
elem["dependencyFileName"] = incl; elem["dependencyFileName"] = incl;
array.push_back(elem); array.push_back(elem);
} }
}
includes["includes"] = array; includes["includes"] = array;
inc_array.push_back(includes); inc_array.push_back(includes);
} }
@@ -2197,7 +2194,7 @@ int SPF_InlineProcedures(void*& context, int winHandler, short* options, short*
} }
extern map<string, map<int, set<string>>> filesToInclude; extern map<string, vector<pair<int, string>>> filesToInclude;
int SPF_InsertIncludesPass(void*& context, int winHandler, short *options, short *projName, short *folderName, char *visFilesToInclude, int SPF_InsertIncludesPass(void*& context, int winHandler, short *options, short *projName, short *folderName, char *visFilesToInclude,
short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize) short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize)
{ {
@@ -2230,8 +2227,9 @@ int SPF_InsertIncludesPass(void*& context, int winHandler, short *options, short
if (sscanf(splited[k].c_str(), "%d", &line) == -1) if (sscanf(splited[k].c_str(), "%d", &line) == -1)
return -5; return -5;
filesToInclude[file][line].insert(splited[k + 1]); auto pair = make_pair(line, splited[k + 1]);
__spf_print(1, " include = [%d %s]\n", line, splited[k + 1].c_str()); filesToInclude[file].push_back(pair);
__spf_print(1, " include = [%d %s]\n", pair.first, pair.second.c_str());
} }
i += 2 * num; i += 2 * num;
} }