Compare commits
4 Commits
9b2cf9426e
...
e88706ae19
| Author | SHA1 | Date | |
|---|---|---|---|
| e88706ae19 | |||
|
|
a6c4dd1fab | ||
|
|
4d51c0d588 | ||
|
|
9ea4e94a74 |
Submodule projects/dvm updated: a711f8ebfd...ca44a63d14
@@ -834,19 +834,21 @@ static string getInterfaceBlock(SgStatement* func, const FuncParam& pars)
|
|||||||
auto copy = duplicateProcedure(func, NULL, false, false, false, true);
|
auto copy = duplicateProcedure(func, NULL, false, false, false, true);
|
||||||
const set<string> idents(pars.identificators.begin(), pars.identificators.end());
|
const set<string> idents(pars.identificators.begin(), pars.identificators.end());
|
||||||
|
|
||||||
|
bool need = (func->symbol()->identifier() == string("bl182"));
|
||||||
|
|
||||||
//remove all exec
|
//remove all exec
|
||||||
SgStatement* st = copy->lexNext();
|
SgStatement* st = copy->lexNext();
|
||||||
SgStatement* last = copy->lastNodeOfStmt();
|
SgStatement* last = copy->lastNodeOfStmt();
|
||||||
vector<SgStatement*> toExtract;
|
vector<SgStatement*> toExtract;
|
||||||
|
|
||||||
while (st != last)
|
while (st != last)
|
||||||
{
|
{
|
||||||
if (isDVM_stat(st) || isSPF_stat(st))
|
if (isDVM_stat(st) || isSPF_stat(st))
|
||||||
{
|
{
|
||||||
if (st->variant() != ACC_ROUTINE_DIR)
|
if (st->variant() != ACC_ROUTINE_DIR)
|
||||||
{
|
{
|
||||||
SgStatement* next = st->lexNext();
|
toExtract.push_back(st);
|
||||||
st->extractStmt();
|
st = st->lexNext();
|
||||||
st = next;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
st = st->lexNext();
|
st = st->lexNext();
|
||||||
@@ -868,6 +870,7 @@ static string getInterfaceBlock(SgStatement* func, const FuncParam& pars)
|
|||||||
while (st != last)
|
while (st != last)
|
||||||
{
|
{
|
||||||
const int var = st->variant();
|
const int var = st->variant();
|
||||||
|
|
||||||
if (var == VAR_DECL
|
if (var == VAR_DECL
|
||||||
|| var == VAR_DECL_90
|
|| var == VAR_DECL_90
|
||||||
|| var == DIM_STAT
|
|| var == DIM_STAT
|
||||||
@@ -877,9 +880,8 @@ static string getInterfaceBlock(SgStatement* func, const FuncParam& pars)
|
|||||||
bool empty = filterFromList(st, idents);
|
bool empty = filterFromList(st, idents);
|
||||||
if (empty)
|
if (empty)
|
||||||
{
|
{
|
||||||
SgStatement* next = st->lexNext();
|
|
||||||
toExtract.push_back(st);
|
toExtract.push_back(st);
|
||||||
st = next;
|
st = st->lexNext();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -508,13 +508,13 @@ AccessingSet AccessingSet::Diff(const AccessingSet& secondSet) const
|
|||||||
return uncovered;
|
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);
|
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++)
|
for (size_t i = 0; i < lhs.allElements.size(); i++)
|
||||||
{
|
{
|
||||||
@@ -529,7 +529,7 @@ bool operator!=(const AccessingSet& lhs, const AccessingSet& rhs)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const ArrayAccessingIndexes& lhs, const ArrayAccessingIndexes& rhs)
|
static bool operator!=(const ArrayAccessingIndexes& lhs, const ArrayAccessingIndexes& rhs)
|
||||||
{
|
{
|
||||||
if(lhs.size() != rhs.size())
|
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());
|
unordered_set<Region*> worklist(DFG->getBasickBlocks());
|
||||||
do
|
do
|
||||||
@@ -661,7 +661,7 @@ void SolveDataFlowIteratively(Region* DFG)
|
|||||||
while (!worklist.empty());
|
while (!worklist.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SolveDataFlow(Region* DFG)
|
static void SolveDataFlow(Region* DFG)
|
||||||
{
|
{
|
||||||
SolveDataFlowIteratively(DFG);
|
SolveDataFlowIteratively(DFG);
|
||||||
for (Region* subRegion : DFG->getSubRegions())
|
for (Region* subRegion : DFG->getSubRegions())
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION_SPF "2413"
|
#define VERSION_SPF "2415"
|
||||||
|
|||||||
@@ -2253,18 +2253,30 @@ int SPF_GetGCovInfo(void*& context, int winHandler, short *options, short *projN
|
|||||||
{
|
{
|
||||||
runPassesForVisualizer(projName, { GCOV_PARSER });
|
runPassesForVisualizer(projName, { GCOV_PARSER });
|
||||||
|
|
||||||
string resVal = "";
|
json gcov_array = json::array();
|
||||||
bool first = true;
|
for (auto& byFile : gCovInfo)
|
||||||
for (auto &byFile : gCovInfo)
|
|
||||||
{
|
{
|
||||||
if (!first)
|
json fileGCov;
|
||||||
resVal += "@";
|
fileGCov["file"] = byFile.first;
|
||||||
resVal += byFile.first + "@";
|
|
||||||
for (auto &elem : byFile.second)
|
json info_array = json::array();
|
||||||
resVal += to_string(elem.first) + " " + to_string(elem.second.getExecutedCount()) + " ";
|
for (auto& elem : byFile.second)
|
||||||
first = false;
|
{
|
||||||
|
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);
|
copyStringToShort(result, resVal);
|
||||||
retSize = (int)resVal.size();
|
retSize = (int)resVal.size();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user