From d2f5e5fcc1d476a9b128f8f7d954142b5d9bf3d2 Mon Sep 17 00:00:00 2001 From: ALEXks Date: Wed, 15 Jan 2025 15:23:49 +0300 Subject: [PATCH] fixed DECLARE --- sapfor/experts/Sapfor_2017/_src/Sapfor.cpp | 20 +++++++++++++++++++ .../experts/Sapfor_2017/_src/Utils/version.h | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp index e16c05c..c4d9961 100644 --- a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp @@ -1609,6 +1609,26 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne } } } + + if (curr_regime == EXTRACT_PARALLEL_DIRS) + { + for (int i = n - 1; i >= 0; --i) + { + SgFile* file = &(project.file(i)); + + SgStatement* st = file->firstStatement(); + vector declares; + while (st) + { + if (st->variant() == ACC_DECLARE_DIR) + declares.push_back(st); + st = st->lexNext(); + } + + for (auto& elem : declares) + elem->deleteStmt(); + } + } } else if (curr_regime == DEF_USE_STAGE1) { diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/version.h b/sapfor/experts/Sapfor_2017/_src/Utils/version.h index a501899..8e88559 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 "2381" +#define VERSION_SPF "2382"