Skip to content

Commit

Permalink
SVFG: refactor fromValue to use SVFIR
Browse files Browse the repository at this point in the history
  • Loading branch information
gerion0 committed Nov 15, 2022
1 parent 67fbf56 commit e3be025
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/Graphs/SVFG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,22 +577,22 @@ void SVFG::dump(const std::string& file, bool simple)

std::set<const SVFGNode*> SVFG::fromValue(const llvm::Value* value) const
{
SVFIR* pag = SVFIR::getPAG();
SVFIR* svfir = SVFIR::getPAG();
std::set<const SVFGNode*> ret;
// search for all PAGEdges first
for (const PAGEdge* pagEdge : pag->getValueEdges(value))
// search for all SVFStmts first
for (const SVFStmt* svfStmt : svfir->getValueEdges(value))
{
PAGEdgeToStmtVFGNodeMapTy::const_iterator it = PAGEdgeToStmtVFGNodeMap.find(pagEdge);
PAGEdgeToStmtVFGNodeMapTy::const_iterator it = PAGEdgeToStmtVFGNodeMap.find(svfStmt);
if (it != PAGEdgeToStmtVFGNodeMap.end())
{
ret.emplace(it->second);
}
}
// add all PAGNodes
PAGNode* pagNode = pag->getGNode(pag->getValueNode(value));
if(hasDef(pagNode))
// add all SVFVars
SVFVar* svfVar = svfir->getGNode(svfir->getValueNode(value));
if(hasDef(svfVar))
{
ret.emplace(getDefSVFGNode(pagNode));
ret.emplace(getDefSVFGNode(svfVar));
}
return ret;
}
Expand Down

0 comments on commit e3be025

Please sign in to comment.