moved LoopGraph to json
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user