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

Public Types

typedef VFGNode NodeType

Public Member Functions

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

Member Typedef Documentation

◆ NodeType

typedef VFGNode SVF::DOTGraphTraits< VFG * >::NodeType

Definition at line 1090 of file VFG.cpp.

Constructor & Destructor Documentation

◆ DOTGraphTraits()

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

Definition at line 1091 of file VFG.cpp.

Member Function Documentation

◆ getCompleteNodeLabel()

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

Return label of a VFG node with MemSSA information.

Definition at line 1166 of file VFG.cpp.

1167 {
1168
1172 {
1173 rawstr << stmtNode->toString();
1174 }
1176 {
1177 rawstr << bop->toString();
1178 }
1180 {
1181 rawstr << uop->toString();
1182 }
1184 {
1185 rawstr << cmp->toString();
1186 }
1188 {
1189 rawstr << phi->toString();
1190 }
1192 {
1193 rawstr << fp->toString();
1194 }
1196 {
1197 rawstr << ap->toString();
1198 }
1200 {
1201 rawstr << nptr->toString();
1202 }
1204 {
1205 rawstr << ar->toString();
1206 }
1208 {
1209 rawstr << fr->toString();
1210 }
1212 {
1213 rawstr << mr->toString();
1214 }
1216 {
1217 rawstr << branchNode->toString();
1218 }
1219 else
1220 assert(false && "what else kinds of nodes do we have??");
1221
1222 return rawstr.str();
1223 }

◆ getEdgeAttributes()

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

Definition at line 1316 of file VFG.cpp.

1317 {
1318 VFGEdge* edge = *(EI.getCurrent());
1319 assert(edge && "No edge found!!");
1321 {
1323 return "style=solid,color=red";
1325 return "style=solid,color=blue";
1326 else
1327 return "style=solid";
1328 }
1330 {
1332 return "style=dashed,color=red";
1334 return "style=dashed,color=blue";
1335 else
1336 return "style=dashed";
1337 }
1338 else
1339 {
1340 assert(false && "what else edge we have?");
1341 }
1342 return "";
1343 }

◆ getEdgeSourceLabel()

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

Definition at line 1346 of file VFG.cpp.

1347 {
1348 VFGEdge* edge = *(EI.getCurrent());
1349 assert(edge && "No edge found!!");
1350
1354 rawstr << dirCall->getCallSiteId();
1356 rawstr << dirRet->getCallSiteId();
1357
1358 return rawstr.str();
1359 }

◆ getGraphName()

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

Return name of the graph.

Definition at line 1097 of file VFG.cpp.

1098 {
1099 return "VFG";
1100 }

◆ getNodeAttributes()

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

Definition at line 1225 of file VFG.cpp.

1226 {
1229
1230 rawstr << "shape=record";
1231
1233 {
1234 const SVFStmt* edge = stmtNode->getSVFStmt();
1236 {
1237 rawstr << ",color=green";
1238 }
1239 else if (SVFUtil::isa<CopyStmt>(edge))
1240 {
1241 rawstr << ",color=black";
1242 }
1243 else if (SVFUtil::isa<RetPE>(edge))
1244 {
1245 rawstr << ",color=black,style=dotted";
1246 }
1247 else if (SVFUtil::isa<GepStmt>(edge))
1248 {
1249 rawstr << ",color=\"purple:purple\"";
1250 }
1251 else if (SVFUtil::isa<StoreStmt>(edge))
1252 {
1253 rawstr << ",color=blue";
1254 }
1255 else if (SVFUtil::isa<LoadStmt>(edge))
1256 {
1257 rawstr << ",color=red";
1258 }
1259 else
1260 {
1261 assert(0 && "No such kind edge!!");
1262 }
1263 rawstr << "";
1264 }
1266 {
1267 rawstr << ",color=grey";
1268 }
1270 {
1271 rawstr << ",color=grey";
1272 }
1274 {
1275 rawstr << ",color=grey";
1276 }
1278 {
1279 rawstr << ",color=black";
1280 }
1282 {
1283 rawstr << ",color=grey";
1284 }
1286 {
1287 rawstr << ",color=yellow,penwidth=2";
1288 }
1290 {
1291 rawstr << ",color=yellow,penwidth=2";
1292 }
1294 {
1295 rawstr << ",color=yellow,penwidth=2";
1296 }
1298 {
1299 rawstr << ",color=yellow,penwidth=2";
1300 }
1302 {
1303 rawstr << ",color=orange,penwidth=2";
1304 }
1306 {
1307 rawstr << ",color=gold,penwidth=2";
1308 }
1309 else
1310 assert(false && "no such kind of node!!");
1311
1312 return rawstr.str();
1313 }

◆ getNodeLabel()

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

Definition at line 1102 of file VFG.cpp.

1103 {
1104 if (isSimple())
1105 return getSimpleNodeLabel(node, graph);
1106 else
1108 }
static std::string getCompleteNodeLabel(NodeType *node, VFG *)
Return label of a VFG node with MemSSA information.
Definition VFG.cpp:1166
static std::string getSimpleNodeLabel(NodeType *node, VFG *)
Return label of a VFG node without MemSSA information.
Definition VFG.cpp:1111

◆ getSimpleNodeLabel()

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

Return label of a VFG node without MemSSA information.

Definition at line 1111 of file VFG.cpp.

1112 {
1116 {
1117 rawstr << stmtNode->toString();
1118 }
1120 {
1121 rawstr << tphi->toString();
1122 }
1124 {
1125 rawstr << fp->toString();
1126 }
1128 {
1129 rawstr << ap->toString();
1130 }
1132 {
1133 rawstr << ar->toString();
1134 }
1136 {
1137 rawstr << fr->toString();
1138 }
1140 {
1141 rawstr << "NullPtr";
1142 }
1144 {
1145 rawstr << bop->toString();
1146 }
1148 {
1149 rawstr << uop->toString();
1150 }
1152 {
1153 rawstr << cmp->toString();;
1154 }
1156 {
1157 rawstr << branchNode->toString();
1158 }
1159 else
1160 assert(false && "what else kinds of nodes do we have??");
1161
1162 return rawstr.str();
1163 }

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