From 66c075b8ce602219784b85d9f2d890e1e1c5770f Mon Sep 17 00:00:00 2001 From: ALEXks Date: Fri, 6 Oct 2023 10:09:47 +0300 Subject: [PATCH] added template_info --- sapfor/experts/Sapfor_2017/_src/Sapfor.cpp | 26 +++++++++++++++++++ .../Sapfor_2017/_src/Utils/SgUtils.cpp | 2 -- .../experts/Sapfor_2017/_src/Utils/version.h | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp index 9dda347..88753d3 100644 --- a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp @@ -2536,8 +2536,23 @@ void runPass(const int curr_regime, const char *proj_name, const char *folderNam } } + FILE* templatesInfo = NULL; + if (consoleMode) { + string file = (folderName) ? (folderName + string("/")) : ""; + file += "templates_info_"; + file += to_string(i); + file += ".txt"; + + templatesInfo = fopen(file.c_str(), "w"); + if (templatesInfo == NULL) + printInternalError(convertFileName(__FILE__).c_str(), __LINE__); + } + for (int z = 0; z < parallelRegions.size(); ++z) { + if (consoleMode) + fprintf(templatesInfo, "FOR region %s\n", parallelRegions[z]->GetName().c_str()); + const DataDirective& dataDirectives = parallelRegions[z]->GetDataDir(); const vector& currentVariant = parallelRegions[z]->GetCurrentVariant(); @@ -2545,12 +2560,23 @@ void runPass(const int curr_regime, const char *proj_name, const char *folderNam for (int z1 = 0; z1 < currentVariant.size(); ++z1) { if (tmp[z1].first->IsTemplate()) + { + if (consoleMode) + { + SgExpression* rule = new SgExpression(EXPR_LIST); + tmp[z1].second[currentVariants[z1][z]].GenRule(new File(current_file), new Expression(rule), tmp[z1].first->GetNewTemplateDimsOrder()); + fprintf(templatesInfo, "%s(%s)\n", tmp[z1].first->GetShortName().c_str(), rule->unparse()); + } tmp[z1].first->ClearTemplateClones(); + } } } if (tmpFolder != "" && consoleMode) folderName = NULL; + + if (consoleMode) + fclose(templatesInfo); } } break; diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp b/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp index 02e66e0..b8d95c6 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp @@ -4383,8 +4383,6 @@ void removeSpecialCommentsFromProject(SgFile* file) genVersionDone.erase(file); } } - if (stF->lineNumber() > 0) - break; stF = stF->lexNext(); } } diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/version.h b/sapfor/experts/Sapfor_2017/_src/Utils/version.h index 9b24da1..7c6d1bb 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 "2222" +#define VERSION_SPF "2223"