From 0c9f0664fd1a907be625c3b475ffca2807c570d1 Mon Sep 17 00:00:00 2001 From: ALEXks Date: Tue, 11 Mar 2025 15:24:36 +0300 Subject: [PATCH] added module symbols initiazliation --- sapfor/experts/Sapfor_2017/_src/Sapfor.cpp | 17 +++++++++++++++-- .../Sapfor_2017/_src/Utils/module_utils.cpp | 2 +- .../Sapfor_2017/_src/Utils/module_utils.h | 1 + sapfor/experts/Sapfor_2017/_src/Utils/version.h | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp index c221a1c..2190d3a 100644 --- a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp @@ -35,6 +35,8 @@ #include "Utils/errors.h" #include "Utils/SgUtils.h" +#include "Utils/module_utils.h" + #include "ProjectManipulation/ParseFiles.h" #include "ProjectManipulation/PerfAnalyzer.h" #include "ProjectManipulation/ConvertFiles.h" @@ -57,7 +59,6 @@ #include "Predictor/PredictScheme.h" #include "Predictor/PredictorModel.h" -#include "ExpressionTransform/expr_transform.h" #include "SageAnalysisTool/depInterfaceExt.h" #include "DvmhRegions/DvmhRegionInserter.h" #include "DvmhRegions/LoopChecker.h" @@ -496,8 +497,20 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne else if (curr_regime == CALL_GRAPH) { auto it = allFuncInfo.find(file_name); - if (it == allFuncInfo.end()) + if (it == allFuncInfo.end()) { functionAnalyzer(file, allFuncInfo, getObjectForFileFromMap(file_name, loopGraph), getObjectForFileFromMap(file_name, SPF_messages), fullIR); + + it = allFuncInfo.find(file_name); + //init module symbols + if (it != allFuncInfo.end()) + { + for (auto& func : it->second) + { + SgStatement* currF = func->funcPointer; + const auto& tmp = getModuleSymbols(currF); + } + } + } } else if (curr_regime == CALL_GRAPH2) { diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/module_utils.cpp b/sapfor/experts/Sapfor_2017/_src/Utils/module_utils.cpp index 84659fc..1db7ad5 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/module_utils.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Utils/module_utils.cpp @@ -307,7 +307,7 @@ static void getModuleSymbols(SgStatement* func, set& symbs) } } -static const set& getModuleSymbols(SgStatement *func) +const set& getModuleSymbols(SgStatement *func) { if (symbolsForFunc.find(func) != symbolsForFunc.end()) return symbolsForFunc[func]; diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/module_utils.h b/sapfor/experts/Sapfor_2017/_src/Utils/module_utils.h index fb14657..8fd21da 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/module_utils.h +++ b/sapfor/experts/Sapfor_2017/_src/Utils/module_utils.h @@ -1,5 +1,6 @@ #pragma once +const std::set& getModuleSymbols(SgStatement* func); void getModulesAndFunctions(SgFile* file, std::vector& modulesAndFunctions); void findModulesInFile(SgFile* file, std::vector& modules); std::map> createMapOfModuleUses(SgFile* file); diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/version.h b/sapfor/experts/Sapfor_2017/_src/Utils/version.h index 8ad9dca..fefbd0c 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 "2395" +#define VERSION_SPF "2396"