diff --git a/sapfor/experts/Sapfor_2017/_src/Distribution/Distribution.cpp b/sapfor/experts/Sapfor_2017/_src/Distribution/Distribution.cpp index a88ec49..6f99a0c 100644 --- a/sapfor/experts/Sapfor_2017/_src/Distribution/Distribution.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Distribution/Distribution.cpp @@ -373,14 +373,14 @@ namespace Distribution vector> vertByTrees; set unqieTrees = G.FindTrees(trees, vertByTrees); - __spf_print(needPrint, "GRAPH size: |V| = %d, |E| = %d\n", G.GetNumberOfV(), G.GetNumberOfE() / 2); - __spf_print(needPrint, "TREES count %d\n", (int)unqieTrees.size()); + __spf_print(needPrint, " GRAPH size: |V| = %d, |E| = %d\n", G.GetNumberOfV(), G.GetNumberOfE() / 2); + __spf_print(needPrint, " TREES count %d\n", (int)unqieTrees.size()); vector tmp; for (int z = 0; z < vertByTrees.size(); ++z) if (vertByTrees[z].size()) - __spf_print(needPrint, "TREES %d: V = %d, E = %d\n", z, (int)vertByTrees[z].size(), G.MakeConnected(vertByTrees[z][0], tmp).second); + __spf_print(needPrint, " TREES %d: V = %d, E = %d\n", z, (int)vertByTrees[z].size(), G.MakeConnected(vertByTrees[z][0], tmp).second); else - __spf_print(needPrint, "TREES %d: V = %d, E = %d\n", z, 0, 0); + __spf_print(needPrint, " TREES %d: V = %d, E = %d\n", z, 0, 0); toDelArcs = G.CreateMaximumSpanningTree(); return make_pair(allOnlySecondType, globalSum); @@ -401,7 +401,7 @@ namespace Distribution maxElem = std::max(maxElem, cycleShortInfo); if (maxElem != 0 && needPrint) - printf("SAPFOR: max elem for cache %lld, in MB: %f\n", maxElem, maxElem / 1024. / 1024. * sizeof(unsigned)); + printf(" SAPFOR: max elem for cache %lld, in MB: %f\n", maxElem, maxElem / 1024. / 1024. * sizeof(unsigned)); unsigned *fastCache = new unsigned[maxElem]; memset(fastCache, 0, sizeof(unsigned) * maxElem); @@ -409,7 +409,7 @@ namespace Distribution char buf[256]; if (needPrint) { - sprintf(buf, "PROF: [%d TREE]:\n", k); + sprintf(buf, " PROF: [%d TREE]:\n", k); addToGlobalBufferAndPrint(buf); } diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/module_utils.cpp b/sapfor/experts/Sapfor_2017/_src/Utils/module_utils.cpp index 5be4521..84659fc 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/module_utils.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Utils/module_utils.cpp @@ -296,12 +296,8 @@ static SgStatement* findModWithName(const vector& modules, const s static map> symbolsForFunc; static set allFiles; -static const set& getModeulSymbols(SgStatement *func) +static void getModuleSymbols(SgStatement* func, set& symbs) { - if (symbolsForFunc.find(func) != symbolsForFunc.end()) - return symbolsForFunc[func]; - - set symbs; SgSymbol* s = func->symbol()->next(); while (s) { @@ -309,6 +305,20 @@ static const set& getModeulSymbols(SgStatement *func) symbs.insert(s); s = s->next(); } +} + +static const set& getModuleSymbols(SgStatement *func) +{ + if (symbolsForFunc.find(func) != symbolsForFunc.end()) + return symbolsForFunc[func]; + + set symbs; + getModuleSymbols(func, symbs); + + //if function in contains + func = func->controlParent(); + if (isSgProgHedrStmt(func)) + getModuleSymbols(func, symbs); symbolsForFunc[func] = symbs; return symbolsForFunc[func]; @@ -317,16 +327,12 @@ static const set& getModeulSymbols(SgStatement *func) SgSymbol* getNameInLocation(SgStatement* func, const string& varName, const string& locName) { map altNames; - for (const auto& s : getModeulSymbols(func)) + for (const auto& s : getModuleSymbols(func)) { SgSymbol* orig = OriginalSymbol(s); + //any suitable symbol can be used if (orig->identifier() == varName && orig->scope()->symbol()->identifier() == locName) - { - if (altNames.count(s->identifier())) - printInternalError(convertFileName(__FILE__).c_str(), __LINE__); - altNames[s->identifier()] = s; - } } if (altNames.size() > 0) diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/version.h b/sapfor/experts/Sapfor_2017/_src/Utils/version.h index 3c9fac7..88a95aa 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 "2393" +#define VERSION_SPF "2394"