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

Public Types

typedef SVFVar 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 NodeT, typename GraphType>
std::string getNodeLabel (NodeT, const GraphType &)

Static Public Member Functions

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

Write value flow graph into dot file for debugging

Definition at line 380 of file IRGraph.cpp.

Member Typedef Documentation

◆ ChildIteratorType

typedef NodeType::iterator SVF::DOTGraphTraits< IRGraph * >::ChildIteratorType

Definition at line 384 of file IRGraph.cpp.

◆ NodeType

typedef SVFVar SVF::DOTGraphTraits< IRGraph * >::NodeType

Definition at line 383 of file IRGraph.cpp.

Constructor & Destructor Documentation

◆ DOTGraphTraits()

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

Definition at line 385 of file IRGraph.cpp.

385 :
387 {
388 }
DefaultDOTGraphTraits(bool simple=false)

Member Function Documentation

◆ getEdgeAttributes()

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

Definition at line 458 of file IRGraph.cpp.

459 {
462
463 rawstr << "shape=record";
464
465 const SVFStmt* edge = *(EI.getCurrent());
466 assert(edge && "No edge found!!");
468 {
469 rawstr << ",color=green";
470 }
472 {
473 rawstr << ",color=black";
474 }
475 else if (SVFUtil::isa<GepStmt>(edge))
476 {
477 rawstr << ",color=\"purple:purple\"";
478 }
480 {
481 rawstr << ",color=blue";
482 }
484 {
485 rawstr << ",color=red";
486 }
487 else if (SVFUtil::isa<PhiStmt>(edge))
488 {
489 rawstr << ",color=grey";
490 }
492 {
493 rawstr << ",color=grey";
494 }
495 else if (SVFUtil::isa<CmpStmt>(edge))
496 {
497 rawstr << ",color=grey";
498 }
500 {
501 rawstr << ",color=grey";
502 }
504 {
505 rawstr << ",color=grey";
506 }
508 {
509 rawstr << ",color=grey";
510 }
512 {
513 rawstr << ",color=Turquoise";
514 }
516 {
517 rawstr << ",color=Turquoise";
518 }
519 else if (SVFUtil::isa<CallPE>(edge))
520 {
521 rawstr << ",color=black,style=dashed";
522 }
523 else if (SVFUtil::isa<RetPE>(edge))
524 {
525 rawstr << ",color=black,style=dotted";
526 }
527 else
528 {
529 assert(false && "No such kind edge!!");
530 }
531
532 return rawstr.str();
533 }

◆ getEdgeSourceLabel()

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

Definition at line 536 of file IRGraph.cpp.

537 {
538 const SVFStmt* edge = *(EI.getCurrent());
539 assert(edge && "No edge found!!");
541 {
542 return calledge->getFunEntryICFGNode()->getSourceLoc();
543 }
544 else if(const RetPE* retedge = SVFUtil::dyn_cast<RetPE>(edge))
545 {
546 return retedge->getCallSite()->getSourceLoc();
547 }
548 return "";
549 }

◆ getGraphName()

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

Return name of the graph.

Definition at line 391 of file IRGraph.cpp.

392 {
393 return graph->getGraphName();
394 }
static std::string getGraphName(const GraphType &)

◆ getNodeAttributes()

std::string SVF::DOTGraphTraits< IRGraph * >::getNodeAttributes ( SVFVar * node,
IRGraph *  )
inlinestatic

Definition at line 420 of file IRGraph.cpp.

421 {
423 {
425 return "shape=hexagon";
427 return "shape=diamond";
428 else
429 return "shape=box";
430 }
431 else if (SVFUtil::isa<ObjVar>(node))
432 {
434 return "shape=doubleoctagon";
436 return "shape=box3d";
438 return "shape=tab";
439 else
440 return "shape=component";
441 }
443 {
444 return "shape=Mrecord";
445 }
447 {
448 return "shape=octagon";
449 }
450 else
451 {
452 assert(0 && "no such kind!!");
453 }
454 return "";
455 }

◆ getNodeLabel()

std::string SVF::DOTGraphTraits< IRGraph * >::getNodeLabel ( SVFVar * node,
IRGraph *  )
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 406 of file IRGraph.cpp.

407 {
410 // print function info
411 if (node->getFunction())
412 rawstr << "[" << node->getFunction()->getName() << "] ";
413
414 rawstr << node->toString();
415
416 return rawstr.str();
417
418 }

◆ isNodeHidden()

bool SVF::DOTGraphTraits< IRGraph * >::isNodeHidden ( SVFVar * node,
IRGraph *  )
inlinestatic

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

Definition at line 398 of file IRGraph.cpp.

399 {
400 if (Options::ShowHiddenNode()) return false;
401 else return node->isIsolatedNode();
402 }

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