Skip to content

Commit 1a5e6ed

Browse files
committed
SVFG: refactor fromValue to use SVFIR
1 parent e4d90dd commit 1a5e6ed

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/Graphs/SVFG.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -578,22 +578,22 @@ void SVFG::dump(const std::string& file, bool simple)
578578

579579
std::set<const SVFGNode*> SVFG::fromValue(const llvm::Value* value) const
580580
{
581-
SVFIR* pag = SVFIR::getPAG();
581+
SVFIR* svfir = SVFIR::getPAG();
582582
std::set<const SVFGNode*> ret;
583-
// search for all PAGEdges first
584-
for (const PAGEdge* pagEdge : pag->getValueEdges(value))
583+
// search for all SVFStmts first
584+
for (const SVFStmt* svfStmt : svfir->getValueEdges(value))
585585
{
586-
PAGEdgeToStmtVFGNodeMapTy::const_iterator it = PAGEdgeToStmtVFGNodeMap.find(pagEdge);
586+
PAGEdgeToStmtVFGNodeMapTy::const_iterator it = PAGEdgeToStmtVFGNodeMap.find(svfStmt);
587587
if (it != PAGEdgeToStmtVFGNodeMap.end())
588588
{
589589
ret.emplace(it->second);
590590
}
591591
}
592-
// add all PAGNodes
593-
PAGNode* pagNode = pag->getGNode(pag->getValueNode(value));
594-
if(hasDef(pagNode))
592+
// add all SVFVars
593+
SVFVar* svfVar = svfir->getGNode(svfir->getValueNode(value));
594+
if(hasDef(svfVar))
595595
{
596-
ret.emplace(getDefSVFGNode(pagNode));
596+
ret.emplace(getDefSVFGNode(svfVar));
597597
}
598598
return ret;
599599
}

0 commit comments

Comments
 (0)