Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
SVF::SlicedSVFGView Class Reference

#include <SlicedGraphs.h>

Public Member Functions

 SlicedSVFGView (const SlicedICFGView *icfgView, const SVFG *svfg=nullptr)
 
bool isKeptNode (const SVFGNode *n) const
 Whether the node is retained (see the class comment for the rule).
 
bool isKeptEdge (const SVFGEdge *e) const
 Whether the edge is retained: both endpoints kept (no bridges).
 
const SlicedICFGViewgetICFGView () const
 
const SVFGgetSVFG () const
 
void setSVFG (const SVFG *g)
 Bind the underlying SVFG (enables node iteration and dumping).
 
void dump (const std::string &filename) const
 Dump the sliced SVFG (retained nodes/edges only) via GraphWriter.
 

Private Attributes

const SlicedICFGViewicfgView
 
const SVFGsvfg
 

Detailed Description

Definition at line 267 of file SlicedGraphs.h.

Constructor & Destructor Documentation

◆ SlicedSVFGView()

SVF::SlicedSVFGView::SlicedSVFGView ( const SlicedICFGView icfgView,
const SVFG svfg = nullptr 
)
inlineexplicit

Membership needs only the sliced ICFG view; the SVFG handle (for node iteration and dumping) may be bound later, once the solver has built it.

Definition at line 272 of file SlicedGraphs.h.

273 : icfgView(icfgView), svfg(svfg) {}
const SlicedICFGView * icfgView

Member Function Documentation

◆ dump()

void SVF::SlicedSVFGView::dump ( const std::string &  filename) const

Dump the sliced SVFG (retained nodes/edges only) via GraphWriter.

Definition at line 242 of file SlicedGraphs.cpp.

243{
244 assert(svfg != nullptr && "SlicedSVFGView: bind the SVFG before dumping");
246}
static void WriteGraphToFile(SVF::OutStream &O, const std::string &GraphName, const GraphType &GT, bool simple=false)
std::ostream & outs()
Overwrite llvm::outs()
Definition SVFUtil.h:52
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

◆ getICFGView()

const SlicedICFGView * SVF::SlicedSVFGView::getICFGView ( ) const
inline

Definition at line 284 of file SlicedGraphs.h.

285 {
286 return icfgView;
287 }

◆ getSVFG()

const SVFG * SVF::SlicedSVFGView::getSVFG ( ) const
inline

Definition at line 288 of file SlicedGraphs.h.

289 {
290 return svfg;
291 }

◆ isKeptEdge()

bool SVF::SlicedSVFGView::isKeptEdge ( const SVFGEdge e) const
inline

Whether the edge is retained: both endpoints kept (no bridges).

Definition at line 279 of file SlicedGraphs.h.

280 {
281 return isKeptNode(e->getSrcNode()) && isKeptNode(e->getDstNode());
282 }
bool isKeptNode(const SVFGNode *n) const
Whether the node is retained (see the class comment for the rule).

◆ isKeptNode()

bool SVF::SlicedSVFGView::isKeptNode ( const SVFGNode n) const

Whether the node is retained (see the class comment for the rule).

Definition at line 230 of file SlicedGraphs.cpp.

231{
232 if (SVFUtil::isa<StoreSVFGNode, LoadSVFGNode>(n))
233 {
234 const StmtSVFGNode* stmt = SVFUtil::cast<StmtSVFGNode>(n);
235 const ICFGNode* icfg = stmt->getICFGNode();
236 if (icfg != nullptr && !icfgView->isKeptNode(icfg))
237 return false;
238 }
239 return true;
240}
cJSON * n
Definition cJSON.cpp:2558
bool isKeptNode(const ICFGNode *node) const
Check if a node is in the sliced view.
virtual const ICFGNode * getICFGNode() const
Return corresponding ICFG node.
Definition VFGNode.h:67

◆ setSVFG()

void SVF::SlicedSVFGView::setSVFG ( const SVFG g)
inline

Bind the underlying SVFG (enables node iteration and dumping).

Definition at line 293 of file SlicedGraphs.h.

294 {
295 svfg = g;
296 }

Member Data Documentation

◆ icfgView

const SlicedICFGView* SVF::SlicedSVFGView::icfgView
private

Definition at line 302 of file SlicedGraphs.h.

◆ svfg

const SVFG* SVF::SlicedSVFGView::svfg
private

Definition at line 303 of file SlicedGraphs.h.


The documentation for this class was generated from the following files: