Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
SVF::DOTGraphTraits< PTACallGraph * > Struct Reference
Inheritance diagram for SVF::DOTGraphTraits< PTACallGraph * >:
SVF::DefaultDOTGraphTraits

Public Types

typedef PTACallGraphNode NodeType
 
typedef NodeType::iterator ChildIteratorType
 

Public Member Functions

 DOTGraphTraits (bool isSimple=false)
 
- Public Member Functions inherited from SVF::DefaultDOTGraphTraits
 DefaultDOTGraphTraits (bool simple=false)
 
template<typename GraphType >
std::string getNodeLabel (const void *, const GraphType &)
 

Static Public Member Functions

static std::string getGraphName (PTACallGraph *)
 Return name of the graph.
 
static std::string getNodeLabel (PTACallGraphNode *node, PTACallGraph *)
 Return function name;.
 
static std::string getNodeAttributes (PTACallGraphNode *node, PTACallGraph *)
 
template<class EdgeIter >
static std::string getEdgeAttributes (PTACallGraphNode *, EdgeIter EI, PTACallGraph *)
 
template<class EdgeIter >
static std::string getEdgeSourceLabel (NodeType *, EdgeIter EI)
 
- Static Public Member Functions inherited from SVF::DefaultDOTGraphTraits
template<typename GraphType >
static std::string getGraphName (const GraphType &)
 
template<typename GraphType >
static std::string getGraphProperties (const GraphType &)
 
static bool renderGraphFromBottomUp ()
 
template<typename GraphType >
static bool isNodeHidden (const void *, const GraphType &)
 
template<typename GraphType >
static std::string getNodeIdentifierLabel (const void *, const GraphType &)
 
template<typename GraphType >
static std::string getNodeDescription (const void *, const GraphType &)
 
template<typename GraphType >
static std::string getNodeAttributes (const void *, const GraphType &)
 
template<typename EdgeIter , typename GraphType >
static std::string getEdgeAttributes (const void *, EdgeIter, const GraphType &)
 
template<typename EdgeIter >
static std::string getEdgeSourceLabel (const void *, EdgeIter)
 
template<typename EdgeIter >
static bool edgeTargetsEdgeSource (const void *, EdgeIter)
 
template<typename EdgeIter >
static EdgeIter getEdgeTarget (const void *, EdgeIter I)
 
static bool hasEdgeDestLabels ()
 
static unsigned numEdgeDestLabels (const void *)
 
static std::string getEdgeDestLabel (const void *, unsigned)
 
template<typename GraphType , typename GraphWriter >
static void addCustomGraphFeatures (const GraphType &, GraphWriter &)
 

Additional Inherited Members

- Protected Member Functions inherited from SVF::DefaultDOTGraphTraits
bool isSimple ()
 

Detailed Description

Write value flow graph into dot file for debugging

Definition at line 344 of file PTACallGraph.cpp.

Member Typedef Documentation

◆ ChildIteratorType

Definition at line 348 of file PTACallGraph.cpp.

◆ NodeType

Definition at line 347 of file PTACallGraph.cpp.

Constructor & Destructor Documentation

◆ DOTGraphTraits()

Member Function Documentation

◆ getEdgeAttributes()

template<class EdgeIter >
static std::string SVF::DOTGraphTraits< PTACallGraph * >::getEdgeAttributes ( PTACallGraphNode ,
EdgeIter  EI,
PTACallGraph  
)
inlinestatic

Definition at line 377 of file PTACallGraph.cpp.

379 {
380
381 //TODO: mark indirect call of Fork with different color
382 PTACallGraphEdge* edge = *(EI.getCurrent());
383 assert(edge && "No edge found!!");
384
385 std::string color;
386
387 if (edge->getEdgeKind() == PTACallGraphEdge::TDJoinEdge)
388 {
389 color = "color=green";
390 }
391 else if (edge->getEdgeKind() == PTACallGraphEdge::TDForkEdge)
392 {
393 color = "color=blue";
394 }
395 else
396 {
397 color = "color=black";
398 }
399 if (0 != edge->getIndirectCalls().size())
400 {
401 color = "color=red";
402 }
403 return color;
404 }
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ getEdgeSourceLabel()

template<class EdgeIter >
static std::string SVF::DOTGraphTraits< PTACallGraph * >::getEdgeSourceLabel ( NodeType ,
EdgeIter  EI 
)
inlinestatic

Definition at line 407 of file PTACallGraph.cpp.

408 {
409 PTACallGraphEdge* edge = *(EI.getCurrent());
410 assert(edge && "No edge found!!");
411
412 std::string str;
413 std::stringstream rawstr(str);
414 rawstr << edge->getCallSiteID();
415
416 return rawstr.str();
417 }

◆ getGraphName()

static std::string SVF::DOTGraphTraits< PTACallGraph * >::getGraphName ( PTACallGraph )
inlinestatic

Return name of the graph.

Definition at line 355 of file PTACallGraph.cpp.

356 {
357 return "Call Graph";
358 }

◆ getNodeAttributes()

static std::string SVF::DOTGraphTraits< PTACallGraph * >::getNodeAttributes ( PTACallGraphNode node,
PTACallGraph  
)
inlinestatic

Definition at line 365 of file PTACallGraph.cpp.

366 {
367 const SVFFunction* fun = node->getFunction();
368 if (!SVFUtil::isExtCall(fun))
369 {
370 return "shape=box";
371 }
372 else
373 return "shape=Mrecord";
374 }
const SVFFunction * getFunction() const
Get function of this call node.
bool isExtCall(const SVFFunction *fun)
Definition SVFUtil.h:278

◆ getNodeLabel()

static std::string SVF::DOTGraphTraits< PTACallGraph * >::getNodeLabel ( PTACallGraphNode node,
PTACallGraph  
)
inlinestatic

Return function name;.

Definition at line 360 of file PTACallGraph.cpp.

361 {
362 return node->toString();
363 }
virtual const std::string toString() const

The documentation for this struct was generated from the following file: