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

Public Types

typedef SVFGNode NodeType

Public Member Functions

 DOTGraphTraits (bool isSimple=false)
std::string getNodeLabel (NodeType *node, SVFG *graph)
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 (SVFG *)
 Return name of the graph.
static bool isNodeHidden (SVFGNode *node, SVFG *)
static std::string getSimpleNodeLabel (NodeType *node, SVFG *)
 Return label of a VFG node without MemSSA information.
static std::string getCompleteNodeLabel (NodeType *node, SVFG *)
 Return label of a VFG node with MemSSA information.
static std::string getNodeAttributes (NodeType *node, SVFG *graph)
template<class EdgeIter>
static std::string getEdgeAttributes (NodeType *, EdgeIter EI, SVFG *)
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

Definition at line 830 of file SVFG.cpp.

Member Typedef Documentation

◆ NodeType

typedef SVFGNode SVF::DOTGraphTraits< SVFG * >::NodeType

Definition at line 833 of file SVFG.cpp.

Constructor & Destructor Documentation

◆ DOTGraphTraits()

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

Definition at line 834 of file SVFG.cpp.

Member Function Documentation

◆ getCompleteNodeLabel()

std::string SVF::DOTGraphTraits< SVFG * >::getCompleteNodeLabel ( NodeType * node,
SVFG *  )
inlinestatic

Return label of a VFG node with MemSSA information.

Definition at line 933 of file SVFG.cpp.

934 {
935
939 {
940 rawstr << stmtNode->toString();
941 }
943 {
944 rawstr << bop->toString();
945 }
947 {
948 rawstr << uop->toString();
949 }
951 {
952 rawstr << cmp->toString();
953 }
955 {
956 rawstr << mphi->toString();
957 }
959 {
960 rawstr << tphi->toString();
961 }
963 {
964 rawstr << fi->toString();
965 }
967 {
968 rawstr << fo->toString();
969 }
971 {
972 rawstr << fp->toString();
973 }
975 {
976 rawstr << ai->toString();
977 }
979 {
980 rawstr << ao->toString();
981 }
983 {
984 rawstr << ap->toString();
985 }
987 {
988 rawstr << nptr->toString();
989 }
991 {
992 rawstr << ar->toString();
993 }
995 {
996 rawstr << fr->toString();
997 }
999 {
1000 rawstr << br->toString();
1001 }
1002 else
1003 assert(false && "what else kinds of nodes do we have??");
1004
1005 return rawstr.str();
1006 }

◆ getEdgeAttributes()

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

Definition at line 1130 of file SVFG.cpp.

1131 {
1132 SVFGEdge* edge = *(EI.getCurrent());
1133 assert(edge && "No edge found!!");
1135 {
1137 return "style=solid,color=red";
1139 return "style=solid,color=blue";
1140 else
1141 return "style=solid";
1142 }
1144 {
1146 return "style=dashed,color=red";
1148 return "style=dashed,color=blue";
1149 else
1150 return "style=dashed";
1151 }
1152 return "";
1153 }

◆ getEdgeSourceLabel()

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

Definition at line 1156 of file SVFG.cpp.

1157 {
1158 SVFGEdge* edge = *(EI.getCurrent());
1159 assert(edge && "No edge found!!");
1160
1164 rawstr << dirCall->getCallSiteId();
1166 rawstr << dirRet->getCallSiteId();
1168 rawstr << indCall->getCallSiteId();
1170 rawstr << indRet->getCallSiteId();
1171
1172 return rawstr.str();
1173 }

◆ getGraphName()

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

Return name of the graph.

Definition at line 840 of file SVFG.cpp.

841 {
842 return "SVFG";
843 }

◆ getNodeAttributes()

std::string SVF::DOTGraphTraits< SVFG * >::getNodeAttributes ( NodeType * node,
SVFG * graph )
inlinestatic

dump slice information

Definition at line 1008 of file SVFG.cpp.

1009 {
1012
1013 rawstr << "shape=record";
1014
1016 {
1017 const SVFStmt* edge = stmtNode->getSVFStmt();
1019 {
1020 rawstr << ",color=green";
1021 }
1022 else if (SVFUtil::isa<CopyStmt>(edge))
1023 {
1024 rawstr << ",color=black";
1025 }
1026 else if (SVFUtil::isa<RetPE>(edge))
1027 {
1028 rawstr << ",color=black,style=dotted";
1029 }
1030 else if (SVFUtil::isa<GepStmt>(edge))
1031 {
1032 rawstr << ",color=\"purple:purple\"";
1033 }
1034 else if (SVFUtil::isa<StoreStmt>(edge))
1035 {
1036 rawstr << ",color=blue";
1037 }
1038 else if (SVFUtil::isa<LoadStmt>(edge))
1039 {
1040 rawstr << ",color=red";
1041 }
1042 else
1043 {
1044 assert(0 && "No such kind edge!!");
1045 }
1046 }
1048 {
1049 rawstr << ",color=black";
1050 }
1052 {
1053 rawstr << ",color=black";
1054 }
1056 {
1057 rawstr << ",color=grey";
1058 }
1060 {
1061 rawstr << ",color=yellow,penwidth=2";
1062 }
1064 {
1065 rawstr << ",color=yellow,penwidth=2";
1066 }
1068 {
1069 rawstr << ",color=yellow,penwidth=2";
1070 }
1072 {
1073 rawstr << ",color=yellow,penwidth=2";
1074 }
1076 {
1077 rawstr << ",color=yellow,penwidth=2";
1078 }
1080 {
1081 rawstr << ",color=yellow,penwidth=2";
1082 }
1084 {
1085 rawstr << ",color=yellow,penwidth=2";
1086 }
1088 {
1089 rawstr << ",color=yellow,penwidth=2";
1090 }
1092 {
1093 rawstr << ",color=black,penwidth=2";
1094 }
1096 {
1097 rawstr << ",color=black,penwidth=2";
1098 }
1100 {
1101 rawstr << ",color=black,penwidth=2";
1102 }
1104 {
1105 rawstr << ",color=gold,penwidth=2";
1106 }
1107 else
1108 assert(false && "no such kind of node!!");
1109
1111 if(graph->getStat()->isSource(node))
1112 {
1113 rawstr << ",style=filled, fillcolor=red";
1114 }
1115 else if(graph->getStat()->isSink(node))
1116 {
1117 rawstr << ",style=filled, fillcolor=blue";
1118 }
1119 else if(graph->getStat()->inBackwardSlice(node))
1120 {
1121 rawstr << ",style=filled, fillcolor=yellow";
1122 }
1123 else if(graph->getStat()->inForwardSlice(node))
1124 rawstr << ",style=filled, fillcolor=gray";
1125
1126 return rawstr.str();
1127 }

◆ getNodeLabel()

std::string SVF::DOTGraphTraits< SVFG * >::getNodeLabel ( NodeType * node,
SVFG * graph )
inline

Definition at line 853 of file SVFG.cpp.

854 {
855 if (isSimple())
857 else
859 }
static std::string getSimpleNodeLabel(NodeType *node, SVFG *)
Return label of a VFG node without MemSSA information.
Definition SVFG.cpp:862
static std::string getCompleteNodeLabel(NodeType *node, SVFG *)
Return label of a VFG node with MemSSA information.
Definition SVFG.cpp:933

◆ getSimpleNodeLabel()

std::string SVF::DOTGraphTraits< SVFG * >::getSimpleNodeLabel ( NodeType * node,
SVFG *  )
inlinestatic

Return label of a VFG node without MemSSA information.

Definition at line 862 of file SVFG.cpp.

863 {
867 {
868 rawstr << stmtNode->toString();
869 }
871 {
872 rawstr << tphi->toString();
873 }
875 {
876 rawstr << fp->toString();
877 }
879 {
880 rawstr << ap->toString();
881 }
883 {
884 rawstr << ar->toString();
885 }
887 {
888 rawstr << fr->toString();
889 }
891 {
892 rawstr << fi->toString();
893 }
895 {
896 rawstr << fo->toString();
897 }
899 {
900 rawstr << ai->toString();
901 }
903 {
904 rawstr << ao->toString();
905 }
907 {
908 rawstr << mphi->toString();
909 }
911 {
912 rawstr << "NullPtr";
913 }
915 {
916 rawstr << bop->toString();
917 }
919 {
920 rawstr << uop->toString();
921 }
923 {
924 rawstr << cmp->toString();
925 }
926 else
927 assert(false && "what else kinds of nodes do we have??");
928
929 return rawstr.str();
930 }

◆ isNodeHidden()

bool SVF::DOTGraphTraits< SVFG * >::isNodeHidden ( SVFGNode * node,
SVFG *  )
inlinestatic

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

Definition at line 847 of file SVFG.cpp.

848 {
849 if (Options::ShowHiddenNode()) return false;
850 else return node->getInEdges().empty() && node->getOutEdges().empty();
851 }

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