Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVF::DOTGraphTraits< ConstraintGraph * > Struct Reference
Inheritance diagram for SVF::DOTGraphTraits< ConstraintGraph * >:
SVF::DefaultDOTGraphTraits SVF::DOTGraphTraits< SVFIR * > SVF::DefaultDOTGraphTraits

Public Types

typedef ConstraintNode NodeType

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 &)
Public Member Functions inherited from SVF::DOTGraphTraits< SVFIR * >
 DOTGraphTraits (bool simple=false)

Static Public Member Functions

static std::string getGraphName (ConstraintGraph *)
 Return name of the graph.
static bool isNodeHidden (NodeType *n, ConstraintGraph *)
static std::string getNodeLabel (NodeType *n, ConstraintGraph *)
static std::string getNodeAttributes (NodeType *n, ConstraintGraph *)
template<class EdgeIter>
static std::string getEdgeAttributes (NodeType *, EdgeIter EI, ConstraintGraph *)
template<class EdgeIter>
static std::string getEdgeSourceLabel (NodeType *, EdgeIter)
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

Definition at line 746 of file ConsG.cpp.

Member Typedef Documentation

◆ NodeType

Definition at line 749 of file ConsG.cpp.

Constructor & Destructor Documentation

◆ DOTGraphTraits()

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

Definition at line 750 of file ConsG.cpp.

Member Function Documentation

◆ getEdgeAttributes()

template<class EdgeIter>
std::string SVF::DOTGraphTraits< ConstraintGraph * >::getEdgeAttributes ( NodeType * ,
EdgeIter EI,
ConstraintGraph *  )
inlinestatic

Definition at line 841 of file ConsG.cpp.

842 {
843 ConstraintEdge* edge = *(EI.getCurrent());
844 assert(edge && "No edge found!!");
845 if (edge->getEdgeKind() == ConstraintEdge::Addr)
846 {
847 return "color=green";
848 }
849 else if (edge->getEdgeKind() == ConstraintEdge::Copy)
850 {
851 return "color=black";
852 }
853 else if (edge->getEdgeKind() == ConstraintEdge::NormalGep
854 || edge->getEdgeKind() == ConstraintEdge::VariantGep)
855 {
856 return "color=\"purple:purple\"";
857 }
858 else if (edge->getEdgeKind() == ConstraintEdge::Store)
859 {
860 return "color=blue";
861 }
862 else if (edge->getEdgeKind() == ConstraintEdge::Load)
863 {
864 return "color=red";
865 }
866 else
867 {
868 assert(0 && "No such kind edge!!");
869 }
870 return "";
871 }

◆ getEdgeSourceLabel()

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

Definition at line 874 of file ConsG.cpp.

875 {
876 return "";
877 }

◆ getGraphName()

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

Return name of the graph.

Definition at line 756 of file ConsG.cpp.

757 {
758 return "ConstraintG";
759 }

◆ getNodeAttributes()

std::string SVF::DOTGraphTraits< ConstraintGraph * >::getNodeAttributes ( NodeType * n,
ConstraintGraph *  )
inlinestatic

Definition at line 802 of file ConsG.cpp.

803 {
804 const SVFVar* node = SVFIR::getPAG()->getSVFVar(n->getId());
806 {
808 return "shape=hexagon";
810 return "shape=diamond";
811 else
812 return "shape=box";
813 }
814 else if (SVFUtil::isa<ObjVar>(node))
815 {
817 return "shape=doubleoctagon";
819 return "shape=box3d";
821 return "shape=tab";
822 else
823 return "shape=component";
824 }
826 {
827 return "shape=Mrecord";
828 }
830 {
831 return "shape=octagon";
832 }
833 else
834 {
835 assert(0 && "no such kind!!");
836 }
837 return "";
838 }
const SVFVar * getSVFVar(NodeID id) const
ObjVar/GepObjVar/BaseObjVar.
Definition SVFIR.h:136
static SVFIR * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
Definition SVFIR.h:121

◆ getNodeLabel()

std::string SVF::DOTGraphTraits< ConstraintGraph * >::getNodeLabel ( NodeType * n,
ConstraintGraph *  )
inlinestatic

Return label of a VFG node with two display mode Either you can choose to display the name of the value or the whole instruction

Definition at line 769 of file ConsG.cpp.

770 {
771 const SVFVar* node = SVFIR::getPAG()->getSVFVar(n->getId());
773 bool nameDisplay = true;
776
777 if (briefDisplay)
778 {
780 {
781 if (nameDisplay)
782 rawstr << node->getId() << ":" << node->getName();
783 else
784 rawstr << node->getId();
785 }
786 else
787 rawstr << node->getId();
788 }
789 else
790 {
791 // print the whole value
793 rawstr << node->toString();
794 else
795 rawstr << node->getId() << ":";
796
797 }
798
799 return rawstr.str();
800 }
static const Option< bool > BriefConsCGDotGraph
Definition Options.h:201

◆ isNodeHidden()

bool SVF::DOTGraphTraits< ConstraintGraph * >::isNodeHidden ( NodeType * n,
ConstraintGraph *  )
inlinestatic

Definition at line 761 of file ConsG.cpp.

762 {
763 if (Options::ShowHiddenNode()) return false;
764 else return (n->getInEdges().empty() && n->getOutEdges().empty());
765 }

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