File tree 2 files changed +27
-0
lines changed
2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,11 @@ class SVFG : public VFG
173
173
return getSVFGNode (getDef (pagNode));
174
174
}
175
175
176
+ // / Return the corresponding SVFGNodes to a given llvm::Value.
177
+ // / return an empty list, if the no mapping is possible
178
+ std::set<const SVFGNode*> fromValue (const llvm::Value* value) const ;
179
+
180
+
176
181
// / Perform statistics
177
182
void performStat ();
178
183
Original file line number Diff line number Diff line change @@ -575,6 +575,28 @@ void SVFG::dump(const std::string& file, bool simple)
575
575
GraphPrinter::WriteGraphToFile (outs (), file, this , simple);
576
576
}
577
577
578
+ std::set<const SVFGNode*> SVFG::fromValue (const llvm::Value* value) const
579
+ {
580
+ SVFIR* pag = SVFIR::getPAG ();
581
+ std::set<const SVFGNode*> ret;
582
+ // search for all PAGEdges first
583
+ for (const PAGEdge* pagEdge : pag->getValueEdges (value))
584
+ {
585
+ PAGEdgeToStmtVFGNodeMapTy::const_iterator it = PAGEdgeToStmtVFGNodeMap.find (pagEdge);
586
+ if (it != PAGEdgeToStmtVFGNodeMap.end ())
587
+ {
588
+ ret.emplace (it->second );
589
+ }
590
+ }
591
+ // add all PAGNodes
592
+ PAGNode* pagNode = pag->getGNode (pag->getValueNode (value));
593
+ if (hasDef (pagNode))
594
+ {
595
+ ret.emplace (getDefSVFGNode (pagNode));
596
+ }
597
+ return ret;
598
+ }
599
+
578
600
/* *
579
601
* Get all inter value flow edges at this indirect call site, including call and return edges.
580
602
*/
You can’t perform that action at this time.
0 commit comments