diff --git a/sapfor/experts/Sapfor_2017/_src/LoopAnalyzer/loop_analyzer.cpp b/sapfor/experts/Sapfor_2017/_src/LoopAnalyzer/loop_analyzer.cpp index 5eaebd0..eb584f0 100644 --- a/sapfor/experts/Sapfor_2017/_src/LoopAnalyzer/loop_analyzer.cpp +++ b/sapfor/experts/Sapfor_2017/_src/LoopAnalyzer/loop_analyzer.cpp @@ -3381,7 +3381,7 @@ void insertSpfAnalysisBeforeParalleLoops(const vector &loops) { loop->loop->addAttribute(SPF_ANALYSIS_DIR, spfStat, sizeof(SgStatement)); //uncomment it to debug private analysis - //loop->loop->insertStmtBefore(*spfStat); + //loop->loop->insertStmtBefore(*spfStat, *loop->loop->controlParent()); } insertSpfAnalysisBeforeParalleLoops(loop->children); } diff --git a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp index a06ac73..b1637f2 100644 --- a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp @@ -2075,7 +2075,7 @@ void runPass(const int curr_regime, const char *proj_name, const char *folderNam if (project == NULL && curr_regime != PARSE_FILES) { - project = createProject(proj_name, parallelRegions, subs_parallelRegions, hiddenData, filesNameWithoutExt, moduleUsesByFile, moduleDecls, exctactedModuleStats); + project = createProject(proj_name, parallelRegions, subs_parallelRegions, hiddenData, filesNameWithoutExt, moduleUsesByFile, moduleDecls, exctactedModuleStats, printSymbTable); //first check correctness runPass(VERIFY_FUNC_DECL, proj_name, folderName); } @@ -2540,7 +2540,7 @@ int main(int argc, char **argv) pppaAnalyzer(argc - i, argv + i); else if (string(curr_arg) == "-fdvm") convertFiles(argc - i, argv + i); - else if (string(curr_arg) == "-mpi") { + else if (string(curr_arg) == "-mpi" || string(curr_arg) == "-shared") { sharedMemoryParallelization = 1; ignoreArrayDistributeState = true; } @@ -2590,6 +2590,8 @@ int main(int argc, char **argv) noLogo = true; else if (string(curr_arg) == "-includeAll") inlcudeAllFiles = true; + else if (string(curr_arg) == "-printSymbTable") + printSymbTable = true; break; default: break; diff --git a/sapfor/experts/Sapfor_2017/_src/SapforData.h b/sapfor/experts/Sapfor_2017/_src/SapforData.h index 6e97b67..97fc31e 100644 --- a/sapfor/experts/Sapfor_2017/_src/SapforData.h +++ b/sapfor/experts/Sapfor_2017/_src/SapforData.h @@ -48,6 +48,7 @@ bool noLogo = false; bool withTemplateInfo = false; bool inlcudeAllFiles = false; // for pass INSERT_INLCUDES bool runAsClient = false; // run console project as client for Visualizer +bool printSymbTable = false; uint64_t currentAvailMemory = 0; int QUALITY; // quality of conflicts search in graph diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp b/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp index b8949cb..79b5320 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp @@ -2379,7 +2379,7 @@ void printSymbolTable(SgFile *file, string filter, const set& vars) if (need) { int line = s->scope() ? s->scope()->lineNumber() : -1; - printf("[%d] '%s' type %d ('%s'), location %d line, variant %d, %0lx\n", s->id(), s->identifier(), t ? t->variant() : -1, t ? tag[t->variant()] : "", line, s->variant(), s->thesymb); + printf("[%d] '%s' type %d ('%s'), location %d line, variant %d, addr %p\n", s->id(), s->identifier(), t ? t->variant() : -1, t ? tag[t->variant()] : "", line, s->variant(), s->thesymb); } } } @@ -3142,7 +3142,8 @@ SgProject* createProject(const char* proj_name, map& filesNameWithoutExt, map>& moduleUsesByFile, map& moduleDecls, - map>>& exctactedModuleStats) + map>>& exctactedModuleStats, + bool printSymbTable) { Statement::setSapforRegime(); Statement::deactiveConsistentchecker(); @@ -3150,7 +3151,14 @@ SgProject* createProject(const char* proj_name, SgProject* project = new SgProject(proj_name); addNumberOfFileToAttribute(project); - //printSymbolTable(&project->file(0), ""); + if (printSymbTable) { + for (int z = 0; z < project->numberOfFiles(); ++z) { + SgFile* file = &(project->file(z)); + printf("===== TABLE FOR FILE %s\n", file->filename()); + printSymbolTable(file, ""); + } + exit(0); + } parallelRegions.push_back(new ParallelRegion(0, "DEFAULT")); subs_parallelRegions.push_back(new ParallelRegion(0, "DEFAULT")); diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.h b/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.h index 85f8f45..a21237d 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.h +++ b/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.h @@ -90,7 +90,7 @@ void getVariables(SgExpression* ex, std::set& variables, const std::s template std::set getAllVariables(SgStatement* stFrom, SgStatement* stTo, const std::set& variants); -SgProject* createProject(const char* proj_name, std::vector& parallelRegions, std::vector& subs_parallelRegions, std::map>& hiddenData, std::map& filesNameWithoutExt, std::map>& moduleUsesByFile, std::map& moduleDecls, std::map>>& exctactedModuleStats); +SgProject* createProject(const char* proj_name, std::vector& parallelRegions, std::vector& subs_parallelRegions, std::map>& hiddenData, std::map& filesNameWithoutExt, std::map>& moduleUsesByFile, std::map& moduleDecls, std::map>>& exctactedModuleStats, bool printSymbTable); bool isArrayType(SgType* type); bool isArrayRef(SgExpression* ex); diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/utils.cpp b/sapfor/experts/Sapfor_2017/_src/Utils/utils.cpp index d50b765..13d4081 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/utils.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Utils/utils.cpp @@ -159,7 +159,8 @@ void printHelp(const char **passNames, const int lastPass) printf(" -passInfo print passes information\n"); printf(" -dumpIR print IR information (works only with BUILD_IR pass)\n"); printf(" -ignoreDistArray ingnore array distribution information (set to all arrays no distribution state\n"); - printf(" -mpi shared memory and mpi programs parallelization\n"); + printf(" -shared shared memory and mpi programs parallelization\n"); + printf(" -printSymbTable print all symbol tables of project\n"); printf("\n"); printf(" -F output to folder\n");