Static Value-Flow Analysis
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. More...
 
static std::string getNodeLabel (PTACallGraphNode *node, PTACallGraph *)
 Return function name;. More...
 
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 372 of file PTACallGraph.cpp.

Member Typedef Documentation

◆ ChildIteratorType

Definition at line 376 of file PTACallGraph.cpp.

◆ NodeType

Definition at line 375 of file PTACallGraph.cpp.

Constructor & Destructor Documentation

◆ DOTGraphTraits()

SVF::DOTGraphTraits< PTACallGraph * >::DOTGraphTraits ( bool  isSimple = false)
inline

Definition at line 377 of file PTACallGraph.cpp.

377  :
379  {
380  }
DefaultDOTGraphTraits(bool simple=false)

Member Function Documentation

◆ getEdgeAttributes()

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

Definition at line 405 of file PTACallGraph.cpp.

407  {
408 
409  //TODO: mark indirect call of Fork with different color
410  PTACallGraphEdge* edge = *(EI.getCurrent());
411  assert(edge && "No edge found!!");
412 
413  std::string color;
414 
416  {
417  color = "color=green";
418  }
419  else if (edge->getEdgeKind() == PTACallGraphEdge::TDForkEdge)
420  {
421  color = "color=blue";
422  }
423  else
424  {
425  color = "color=black";
426  }
427  if (0 != edge->getIndirectCalls().size())
428  {
429  color = "color=red";
430  }
431  return color;
432  }
const char *const string
Definition: cJSON.h:172
GEdgeKind getEdgeKind() const
Definition: GenericGraph.h:89
CallInstSet & getIndirectCalls()
Definition: PTACallGraph.h:99

◆ getEdgeSourceLabel()

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

Definition at line 435 of file PTACallGraph.cpp.

436  {
437  PTACallGraphEdge* edge = *(EI.getCurrent());
438  assert(edge && "No edge found!!");
439 
440  std::string str;
441  std::stringstream rawstr(str);
442  rawstr << edge->getCallSiteID();
443 
444  return rawstr.str();
445  }
CallSiteID getCallSiteID() const
Get direct and indirect calls.
Definition: PTACallGraph.h:83

◆ getGraphName()

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

Return name of the graph.

Definition at line 383 of file PTACallGraph.cpp.

384  {
385  return "Call Graph";
386  }

◆ getNodeAttributes()

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

Definition at line 393 of file PTACallGraph.cpp.

394  {
395  const SVFFunction* fun = node->getFunction();
396  if (!SVFUtil::isExtCall(fun))
397  {
398  return "shape=box";
399  }
400  else
401  return "shape=Mrecord";
402  }
const SVFFunction * getFunction() const
Get function of this call node.
Definition: PTACallGraph.h:198
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 388 of file PTACallGraph.cpp.

389  {
390  return node->toString();
391  }
virtual const std::string toString() const

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