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 428 of file CallGraph.cpp.

Member Typedef Documentation

◆ ChildIteratorType

Definition at line 432 of file CallGraph.cpp.

◆ NodeType

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

463 {
464
465 //TODO: mark indirect call of Fork with different color
466 CallGraphEdge* edge = *(EI.getCurrent());
467 assert(edge && "No edge found!!");
468
469 std::string color;
470
471 if (edge->getEdgeKind() == CallGraphEdge::TDJoinEdge)
472 {
473 color = "color=green";
474 }
475 else if (edge->getEdgeKind() == CallGraphEdge::TDForkEdge)
476 {
477 color = "color=blue";
478 }
479 else
480 {
481 color = "color=black";
482 }
483 if (0 != edge->getIndirectCalls().size())
484 {
485 color = "color=red";
486 }
487 return color;
488 }
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 491 of file CallGraph.cpp.

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

◆ getGraphName()

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

Return name of the graph.

Definition at line 439 of file CallGraph.cpp.

440 {
441 return "Call Graph";
442 }

◆ getNodeAttributes()

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

Definition at line 449 of file CallGraph.cpp.

450 {
451 const FunObjVar* fun = node->getFunction();
452 if (!SVFUtil::isExtCall(fun))
453 {
454 return "shape=record";
455 }
456 else
457 return "shape=Mrecord";
458 }
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 444 of file CallGraph.cpp.

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

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