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 NodeT , typename GraphType >
std::string getNodeLabel (NodeT, 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 NodeT >
static const void * getNodeIdentifier (NodeT N)
 
template<typename NodeT , typename GraphType >
static bool isNodeHidden (NodeT, const GraphType &)
 
template<typename NodeT , typename GraphType >
static std::string getNodeIdentifierLabel (NodeT, const GraphType &)
 
template<typename NodeT , typename GraphType >
static std::string getNodeDescription (NodeT, const GraphType &)
 
template<typename NodeT , typename GraphType >
static std::string getNodeAttributes (NodeT, const GraphType &)
 
template<typename NodeT , typename EdgeIter , typename GraphType >
static std::string getEdgeAttributes (NodeT, EdgeIter, const GraphType &)
 
template<typename NodeT , typename EdgeIter >
static std::string getEdgeSourceLabel (NodeT, EdgeIter)
 
template<typename NodeT , typename EdgeIter >
static bool edgeTargetsEdgeSource (NodeT, EdgeIter)
 
template<typename NodeT , typename EdgeIter >
static EdgeIter getEdgeTarget (NodeT, EdgeIter I)
 
static bool hasEdgeDestLabels ()
 
template<typename NodeT >
static unsigned numEdgeDestLabels (NodeT)
 
template<typename NodeT >
static std::string getEdgeDestLabel (NodeT, 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 427 of file CallGraph.cpp.

Member Typedef Documentation

◆ ChildIteratorType

Definition at line 431 of file CallGraph.cpp.

◆ NodeType

Definition at line 430 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 460 of file CallGraph.cpp.

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

◆ getEdgeSourceLabel()

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

Definition at line 490 of file CallGraph.cpp.

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

◆ getGraphName()

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

Return name of the graph.

Definition at line 438 of file CallGraph.cpp.

439 {
440 return "Call Graph";
441 }

◆ getNodeAttributes()

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

Definition at line 448 of file CallGraph.cpp.

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

◆ getNodeLabel()

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

Return function name;.

Definition at line 443 of file CallGraph.cpp.

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

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