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

Public Types

typedef CallGraphNode 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 (CallGraph *)
 Return name of the graph.
 
static std::string getNodeLabel (CallGraphNode *node, CallGraph *)
 Return function name;.
 
static std::string getNodeAttributes (CallGraphNode *node, CallGraph *)
 
template<class EdgeIter >
static std::string getEdgeAttributes (CallGraphNode *, EdgeIter EI, CallGraph *)
 
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 426 of file CallGraph.cpp.

Member Typedef Documentation

◆ ChildIteratorType

Definition at line 430 of file CallGraph.cpp.

◆ NodeType

Definition at line 429 of file CallGraph.cpp.

Constructor & Destructor Documentation

◆ DOTGraphTraits()

Member Function Documentation

◆ getEdgeAttributes()

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

Definition at line 459 of file CallGraph.cpp.

461 {
462
463 //TODO: mark indirect call of Fork with different color
464 CallGraphEdge* edge = *(EI.getCurrent());
465 assert(edge && "No edge found!!");
466
467 std::string color;
468
469 if (edge->getEdgeKind() == CallGraphEdge::TDJoinEdge)
470 {
471 color = "color=green";
472 }
473 else if (edge->getEdgeKind() == CallGraphEdge::TDForkEdge)
474 {
475 color = "color=blue";
476 }
477 else
478 {
479 color = "color=black";
480 }
481 if (0 != edge->getIndirectCalls().size())
482 {
483 color = "color=red";
484 }
485 return color;
486 }
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ getEdgeSourceLabel()

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

Definition at line 489 of file CallGraph.cpp.

490 {
491 CallGraphEdge* edge = *(EI.getCurrent());
492 assert(edge && "No edge found!!");
493
494 std::string str;
495 std::stringstream rawstr(str);
496 rawstr << edge->getCallSiteID();
497
498 return rawstr.str();
499 }

◆ getGraphName()

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

Return name of the graph.

Definition at line 437 of file CallGraph.cpp.

438 {
439 return "Call Graph";
440 }

◆ getNodeAttributes()

static std::string SVF::DOTGraphTraits< CallGraph * >::getNodeAttributes ( CallGraphNode node,
CallGraph  
)
inlinestatic

Definition at line 447 of file CallGraph.cpp.

448 {
449 const FunObjVar* fun = node->getFunction();
450 if (!SVFUtil::isExtCall(fun))
451 {
452 return "shape=box";
453 }
454 else
455 return "shape=Mrecord";
456 }
const FunObjVar * getFunction() const
Get function of this call node.
Definition CallGraph.h:191
bool isExtCall(const FunObjVar *fun)
Definition SVFUtil.cpp:437

◆ getNodeLabel()

static std::string SVF::DOTGraphTraits< CallGraph * >::getNodeLabel ( CallGraphNode node,
CallGraph  
)
inlinestatic

Return function name;.

Definition at line 442 of file CallGraph.cpp.

443 {
444 return node->toString();
445 }
virtual const std::string toString() const
Definition CallGraph.cpp:81

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