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 386 of file PTACallGraph.cpp.

Member Typedef Documentation

◆ ChildIteratorType

Definition at line 390 of file PTACallGraph.cpp.

◆ NodeType

Definition at line 389 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 419 of file PTACallGraph.cpp.

421 {
422
423 //TODO: mark indirect call of Fork with different color
424 PTACallGraphEdge* edge = *(EI.getCurrent());
425 assert(edge && "No edge found!!");
426
427 std::string color;
428
429 if (edge->getEdgeKind() == PTACallGraphEdge::TDJoinEdge)
430 {
431 color = "color=green";
432 }
433 else if (edge->getEdgeKind() == PTACallGraphEdge::TDForkEdge)
434 {
435 color = "color=blue";
436 }
437 else
438 {
439 color = "color=black";
440 }
441 if (0 != edge->getIndirectCalls().size())
442 {
443 color = "color=red";
444 }
445 return color;
446 }
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 449 of file PTACallGraph.cpp.

450 {
451 PTACallGraphEdge* edge = *(EI.getCurrent());
452 assert(edge && "No edge found!!");
453
454 std::string str;
455 std::stringstream rawstr(str);
456 rawstr << edge->getCallSiteID();
457
458 return rawstr.str();
459 }

◆ getGraphName()

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

Return name of the graph.

Definition at line 397 of file PTACallGraph.cpp.

398 {
399 return "Call Graph";
400 }

◆ getNodeAttributes()

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

Definition at line 407 of file PTACallGraph.cpp.

408 {
409 const SVFFunction* fun = node->getFunction();
410 if (!SVFUtil::isExtCall(fun))
411 {
412 return "shape=box";
413 }
414 else
415 return "shape=Mrecord";
416 }
const SVFFunction * getFunction() const
Get function of this call node.
bool isExtCall(const SVFFunction *fun)
Definition SVFUtil.h:269

◆ getNodeLabel()

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

Return function name;.

Definition at line 402 of file PTACallGraph.cpp.

403 {
404 return node->toString();
405 }
virtual const std::string toString() const

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