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 17, 2022
1 parent e4d90dd commit 1a5e6ed
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 @@ -578,22 +578,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 1a5e6ed

Please sign in to comment.