From c8961828bc73160b543c27138099d6acdddc6393 Mon Sep 17 00:00:00 2001 From: ALEXks Date: Tue, 1 Apr 2025 15:31:43 +0300 Subject: [PATCH] moved LoopGraph to json --- src/GraphLoop/graph_loops.cpp | 34 +--------------------------------- src/GraphLoop/graph_loops.h | 1 - 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/src/GraphLoop/graph_loops.cpp b/src/GraphLoop/graph_loops.cpp index 0f68609..f275ce1 100644 --- a/src/GraphLoop/graph_loops.cpp +++ b/src/GraphLoop/graph_loops.cpp @@ -955,39 +955,7 @@ static int calculateNormalChildSize(const LoopGraph *currLoop) return count; } -void convertToString(const LoopGraph *currLoop, string &result) -{ - if (currLoop && currLoop->lineNum > 0) - { - char buf[512]; - result += "#" + std::to_string(currLoop->calls.size()); - for (int i = 0; i < currLoop->calls.size(); ++i) - result += "#" + currLoop->calls[i].first + "#" + std::to_string(currLoop->calls[i].second); - printToBuffer(currLoop, calculateNormalChildSize(currLoop), buf); - result += string(buf); - - result += "#" + std::to_string(currLoop->linesOfExternalGoTo.size()); - for (int i = 0; i < currLoop->linesOfExternalGoTo.size(); ++i) - result += "#" + std::to_string(currLoop->linesOfExternalGoTo[i]); - - result += "#" + std::to_string(currLoop->linesOfInternalGoTo.size()); - for (int i = 0; i < currLoop->linesOfInternalGoTo.size(); ++i) - result += "#" + std::to_string(currLoop->linesOfInternalGoTo[i]); - - result += "#" + std::to_string(currLoop->linesOfIO.size()); - for (auto& i : currLoop->linesOfIO) - result += "#" + std::to_string(i); - - result += "#" + std::to_string(currLoop->linesOfStop.size()); - for (auto& i : currLoop->linesOfStop) - result += "#" + std::to_string(i); - - for (int i = 0; i < (int)currLoop->children.size(); ++i) - convertToString(currLoop->children[i], result); - } -} - -json convertToJson(const LoopGraph* currLoop) +static json convertToJson(const LoopGraph* currLoop) { json loop; const auto& file = currLoop->fileName; diff --git a/src/GraphLoop/graph_loops.h b/src/GraphLoop/graph_loops.h index 887ef29..39fd48b 100644 --- a/src/GraphLoop/graph_loops.h +++ b/src/GraphLoop/graph_loops.h @@ -497,7 +497,6 @@ void processLoopInformationForFunction(std::map>& loopInfo, const std::map>& arrayLinksByFuncCalls); void selectFreeLoopsForParallelization(const std::vector& loops, const std::string& funcName, bool isDistribute, const std::vector& regions, std::vector& messagesForFile); -void convertToString(const LoopGraph* currLoop, std::string& result); int printLoopGraph(const char* fileName, const std::map>& loopGraph, bool withRegs = false); void checkCountOfIter(std::map>& loopGraph, const std::map>& allFuncInfo, std::map>& SPF_messages);