Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
SVF::DefaultDOTGraphTraits Struct Reference

#include <DOTGraphTraits.h>

Inheritance diagram for SVF::DefaultDOTGraphTraits:
SVF::DOTGraphTraits< SVFIR * > SVF::DOTGraphTraits< SVF::PAG * > SVF::DOTGraphTraits< GraphType > SVF::DOTGraphTraits< Ty > SVF::DOTGraphTraits< CFLGraph * > SVF::DOTGraphTraits< CHGraph * > SVF::DOTGraphTraits< CallGraph * > SVF::DOTGraphTraits< IRGraph * > SVF::DOTGraphTraits< TCT * > SVF::DOTGraphTraits< const SlicedICFGView * > SVF::DOTGraphTraits< const SlicedPAGView * > SVF::DOTGraphTraits< const SlicedSVFGView * > SVF::DOTGraphTraits< const SlicedThreadCallGraphView * >

Public Member Functions

 DefaultDOTGraphTraits (bool simple=false)
 
template<typename NodeT , typename GraphType >
std::string getNodeLabel (NodeT, const GraphType &)
 

Static Public Member Functions

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 &)
 

Protected Member Functions

bool isSimple ()
 

Private Attributes

bool IsSimple
 

Detailed Description

DefaultDOTGraphTraits - This class provides the default implementations of all of the DOTGraphTraits methods. If a specialization does not need to override all methods here it should inherit so that it can get the default implementations.

Definition at line 29 of file DOTGraphTraits.h.

Constructor & Destructor Documentation

◆ DefaultDOTGraphTraits()

SVF::DefaultDOTGraphTraits::DefaultDOTGraphTraits ( bool  simple = false)
inlineexplicit

Definition at line 41 of file DOTGraphTraits.h.

41: IsSimple (simple) {}
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

Member Function Documentation

◆ addCustomGraphFeatures()

static void SVF::DefaultDOTGraphTraits::addCustomGraphFeatures ( const GraphType ,
GraphWriter  
)
inlinestatic

addCustomGraphFeatures - If a graph is made up of more than just straight-forward nodes and edges, this is the place to put all of the custom stuff necessary. The GraphWriter object, instantiated with your GraphType is passed in as an argument. You may call arbitrary methods on it to add things to the output graph.

Definition at line 185 of file DOTGraphTraits.h.

185{}

◆ edgeTargetsEdgeSource()

template<typename NodeT , typename EdgeIter >
static bool SVF::DefaultDOTGraphTraits::edgeTargetsEdgeSource ( NodeT  ,
EdgeIter   
)
inlinestatic

edgeTargetsEdgeSource - This method returns true if this outgoing edge should actually target another edge source, not a node. If this method is implemented, getEdgeTarget should be implemented.

Definition at line 141 of file DOTGraphTraits.h.

142 {
143 return false;
144 }

◆ getEdgeAttributes()

static std::string SVF::DefaultDOTGraphTraits::getEdgeAttributes ( NodeT  ,
EdgeIter  ,
const GraphType  
)
inlinestatic

If you want to override the dot attributes printed for a particular edge, override this method.

Definition at line 123 of file DOTGraphTraits.h.

125 {
126 return "";
127 }

◆ getEdgeDestLabel()

template<typename NodeT >
static std::string SVF::DefaultDOTGraphTraits::getEdgeDestLabel ( NodeT  ,
unsigned   
)
inlinestatic

getEdgeDestLabel - If hasEdgeDestLabels, this function returns the incoming edge label with the given index in the given node.

Definition at line 173 of file DOTGraphTraits.h.

174 {
175 return "";
176 }

◆ getEdgeSourceLabel()

template<typename NodeT , typename EdgeIter >
static std::string SVF::DefaultDOTGraphTraits::getEdgeSourceLabel ( NodeT  ,
EdgeIter   
)
inlinestatic

getEdgeSourceLabel - If you want to label the edge source itself, implement this method.

Definition at line 132 of file DOTGraphTraits.h.

133 {
134 return "";
135 }

◆ getEdgeTarget()

template<typename NodeT , typename EdgeIter >
static EdgeIter SVF::DefaultDOTGraphTraits::getEdgeTarget ( NodeT  ,
EdgeIter  I 
)
inlinestatic

getEdgeTarget - If edgeTargetsEdgeSource returns true, this method is called to determine which outgoing edge of Node is the target of this edge.

Definition at line 150 of file DOTGraphTraits.h.

151 {
152 return I;
153 }

◆ getGraphName()

template<typename GraphType >
static std::string SVF::DefaultDOTGraphTraits::getGraphName ( const GraphType )
inlinestatic

getGraphName - Return the label for the graph as a whole. Printed at the top of the graph.

Definition at line 47 of file DOTGraphTraits.h.

48 {
49 return "";
50 }

◆ getGraphProperties()

template<typename GraphType >
static std::string SVF::DefaultDOTGraphTraits::getGraphProperties ( const GraphType )
inlinestatic

getGraphProperties - Return any custom properties that should be included in the top level graph structure for dot.

Definition at line 56 of file DOTGraphTraits.h.

57 {
58 return "";
59 }

◆ getNodeAttributes()

template<typename NodeT , typename GraphType >
static std::string SVF::DefaultDOTGraphTraits::getNodeAttributes ( NodeT  ,
const GraphType  
)
inlinestatic

If you want to specify custom node attributes, this is the place to do so

Definition at line 114 of file DOTGraphTraits.h.

116 {
117 return "";
118 }

◆ getNodeDescription()

template<typename NodeT , typename GraphType >
static std::string SVF::DefaultDOTGraphTraits::getNodeDescription ( NodeT  ,
const GraphType  
)
inlinestatic

Definition at line 106 of file DOTGraphTraits.h.

107 {
108 return "";
109 }

◆ getNodeIdentifier()

template<typename NodeT >
static const void * SVF::DefaultDOTGraphTraits::getNodeIdentifier ( NodeT  N)
inlinestatic

getNodeIdentifier - The value written after "Node" as the dot node id. Defaults to the node reference reinterpreted as an address, which works for pointer NodeRefs; value NodeRefs (e.g. sliced views) override this to return a stable per-node address. (Node params below are templated so the defaults accept any NodeRef, pointer or value.)

Definition at line 75 of file DOTGraphTraits.h.

76 {
77 return static_cast<const void *>(N);
78 }

◆ getNodeIdentifierLabel()

template<typename NodeT , typename GraphType >
static std::string SVF::DefaultDOTGraphTraits::getNodeIdentifierLabel ( NodeT  ,
const GraphType  
)
inlinestatic

Definition at line 100 of file DOTGraphTraits.h.

101 {
102 return "";
103 }

◆ getNodeLabel()

template<typename NodeT , typename GraphType >
std::string SVF::DefaultDOTGraphTraits::getNodeLabel ( NodeT  ,
const GraphType  
)
inline

getNodeLabel - Given a node and a pointer to the top level graph, return the label to print in the node.

Definition at line 91 of file DOTGraphTraits.h.

92 {
93 return "";
94 }

◆ hasEdgeDestLabels()

static bool SVF::DefaultDOTGraphTraits::hasEdgeDestLabels ( )
inlinestatic

hasEdgeDestLabels - If this function returns true, the graph is able to provide labels for edge destinations.

Definition at line 157 of file DOTGraphTraits.h.

158 {
159 return false;
160 }

◆ isNodeHidden()

template<typename NodeT , typename GraphType >
static bool SVF::DefaultDOTGraphTraits::isNodeHidden ( NodeT  ,
const GraphType  
)
inlinestatic

isNodeHidden - If the function returns true, the given node is not displayed in the graph.

Definition at line 83 of file DOTGraphTraits.h.

84 {
85 return false;
86 }

◆ isSimple()

bool SVF::DefaultDOTGraphTraits::isSimple ( )
inlineprotected

Definition at line 35 of file DOTGraphTraits.h.

36 {
37 return IsSimple;
38 }

◆ numEdgeDestLabels()

template<typename NodeT >
static unsigned SVF::DefaultDOTGraphTraits::numEdgeDestLabels ( NodeT  )
inlinestatic

numEdgeDestLabels - If hasEdgeDestLabels, this function returns the number of incoming edge labels the given node has.

Definition at line 165 of file DOTGraphTraits.h.

166 {
167 return 0;
168 }

◆ renderGraphFromBottomUp()

static bool SVF::DefaultDOTGraphTraits::renderGraphFromBottomUp ( )
inlinestatic

renderGraphFromBottomUp - If this function returns true, the graph is emitted bottom-up instead of top-down. This requires graphviz 2.0 to work though.

Definition at line 64 of file DOTGraphTraits.h.

65 {
66 return false;
67 }

Member Data Documentation

◆ IsSimple

bool SVF::DefaultDOTGraphTraits::IsSimple
private

Definition at line 32 of file DOTGraphTraits.h.


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