4 Commits

Author SHA1 Message Date
e88706ae19 made functions static 2025-05-05 22:52:17 +03:00
ALEXks
a6c4dd1fab fixed gcov 2025-05-05 22:52:17 +03:00
ALEXks
4d51c0d588 added json for SPF_GetGCovInfo pass 2025-05-05 22:52:16 +03:00
ALEXks
9ea4e94a74 fixed getInterfaceBlock 2025-05-05 22:52:16 +03:00
5 changed files with 35 additions and 21 deletions

View File

@@ -834,19 +834,21 @@ static string getInterfaceBlock(SgStatement* func, const FuncParam& pars)
auto copy = duplicateProcedure(func, NULL, false, false, false, true);
const set<string> idents(pars.identificators.begin(), pars.identificators.end());
bool need = (func->symbol()->identifier() == string("bl182"));
//remove all exec
SgStatement* st = copy->lexNext();
SgStatement* last = copy->lastNodeOfStmt();
vector<SgStatement*> toExtract;
while (st != last)
{
if (isDVM_stat(st) || isSPF_stat(st))
{
if (st->variant() != ACC_ROUTINE_DIR)
{
SgStatement* next = st->lexNext();
st->extractStmt();
st = next;
toExtract.push_back(st);
st = st->lexNext();
}
else
st = st->lexNext();
@@ -868,6 +870,7 @@ static string getInterfaceBlock(SgStatement* func, const FuncParam& pars)
while (st != last)
{
const int var = st->variant();
if (var == VAR_DECL
|| var == VAR_DECL_90
|| var == DIM_STAT
@@ -877,9 +880,8 @@ static string getInterfaceBlock(SgStatement* func, const FuncParam& pars)
bool empty = filterFromList(st, idents);
if (empty)
{
SgStatement* next = st->lexNext();
toExtract.push_back(st);
st = next;
st = st->lexNext();
continue;
}
}

View File

@@ -508,13 +508,13 @@ AccessingSet AccessingSet::Diff(const AccessingSet& secondSet) const
return uncovered;
}
bool operator!=(const ArrayDimension& lhs, const ArrayDimension& rhs)
static bool operator!=(const ArrayDimension& lhs, const ArrayDimension& rhs)
{
return !(lhs.start == rhs.start && lhs.step == rhs.step && lhs.tripCount == rhs.tripCount);
}
bool operator!=(const AccessingSet& lhs, const AccessingSet& rhs)
static bool operator!=(const AccessingSet& lhs, const AccessingSet& rhs)
{
for (size_t i = 0; i < lhs.allElements.size(); i++)
{
@@ -529,7 +529,7 @@ bool operator!=(const AccessingSet& lhs, const AccessingSet& rhs)
return false;
}
bool operator!=(const ArrayAccessingIndexes& lhs, const ArrayAccessingIndexes& rhs)
static bool operator!=(const ArrayAccessingIndexes& lhs, const ArrayAccessingIndexes& rhs)
{
if(lhs.size() != rhs.size())
{
@@ -628,7 +628,7 @@ Region::Region(LoopGraph* loop, vector<SAPFOR::BasicBlock*>& Blocks)
}
}
void SolveDataFlowIteratively(Region* DFG)
static void SolveDataFlowIteratively(Region* DFG)
{
unordered_set<Region*> worklist(DFG->getBasickBlocks());
do
@@ -661,7 +661,7 @@ void SolveDataFlowIteratively(Region* DFG)
while (!worklist.empty());
}
void SolveDataFlow(Region* DFG)
static void SolveDataFlow(Region* DFG)
{
SolveDataFlowIteratively(DFG);
for (Region* subRegion : DFG->getSubRegions())

View File

@@ -1,3 +1,3 @@
#pragma once
#define VERSION_SPF "2413"
#define VERSION_SPF "2415"

View File

@@ -2253,18 +2253,30 @@ int SPF_GetGCovInfo(void*& context, int winHandler, short *options, short *projN
{
runPassesForVisualizer(projName, { GCOV_PARSER });
string resVal = "";
bool first = true;
for (auto &byFile : gCovInfo)
json gcov_array = json::array();
for (auto& byFile : gCovInfo)
{
if (!first)
resVal += "@";
resVal += byFile.first + "@";
for (auto &elem : byFile.second)
resVal += to_string(elem.first) + " " + to_string(elem.second.getExecutedCount()) + " ";
first = false;
json fileGCov;
fileGCov["file"] = byFile.first;
json info_array = json::array();
for (auto& elem : byFile.second)
{
json item;
item["line"] = elem.first;
item["execution"] = elem.second.getExecutedCount();
info_array.push_back(item);
}
fileGCov["lines"] = info_array;
gcov_array.push_back(fileGCov);
}
json allGCov;
allGCov["allGCov"] = gcov_array;
string resVal = allGCov.dump();
copyStringToShort(result, resVal);
retSize = (int)resVal.size();
}