Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
SVF::DOTGraphTraits< ICFG * > Struct Reference
Inheritance diagram for SVF::DOTGraphTraits< ICFG * >:
SVF::DOTGraphTraits< SVFIR * > SVF::DefaultDOTGraphTraits

Public Types

typedef ICFGNode NodeType
 

Public Member Functions

 DOTGraphTraits (bool isSimple=false)
 
std::string getNodeLabel (NodeType *node, ICFG *graph)
 
- Public Member Functions inherited from SVF::DOTGraphTraits< SVFIR * >
 DOTGraphTraits (bool simple=false)
 
- Public Member Functions inherited from SVF::DefaultDOTGraphTraits
 DefaultDOTGraphTraits (bool simple=false)
 
template<typename GraphType >
std::string getNodeLabel (const void *, const GraphType &)
 

Static Public Member Functions

static std::string getGraphName (ICFG *)
 Return name of the graph.
 
static std::string getSimpleNodeLabel (NodeType *node, ICFG *)
 Return the label of an ICFG node.
 
static bool isNodeHidden (ICFGNode *node, ICFG *)
 
static std::string getNodeAttributes (NodeType *node, ICFG *)
 
template<class EdgeIter >
static std::string getEdgeAttributes (NodeType *, EdgeIter EI, ICFG *)
 
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 GraphType >
static bool isNodeHidden (const void *, const GraphType &)
 
template<typename GraphType >
static std::string getNodeIdentifierLabel (const void *, const GraphType &)
 
template<typename GraphType >
static std::string getNodeDescription (const void *, const GraphType &)
 
template<typename GraphType >
static std::string getNodeAttributes (const void *, const GraphType &)
 
template<typename EdgeIter , typename GraphType >
static std::string getEdgeAttributes (const void *, EdgeIter, const GraphType &)
 
template<typename EdgeIter >
static std::string getEdgeSourceLabel (const void *, EdgeIter)
 
template<typename EdgeIter >
static bool edgeTargetsEdgeSource (const void *, EdgeIter)
 
template<typename EdgeIter >
static EdgeIter getEdgeTarget (const void *, EdgeIter I)
 
static bool hasEdgeDestLabels ()
 
static unsigned numEdgeDestLabels (const void *)
 
static std::string getEdgeDestLabel (const void *, 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 482 of file ICFG.cpp.

Member Typedef Documentation

◆ NodeType

Definition at line 485 of file ICFG.cpp.

Constructor & Destructor Documentation

◆ DOTGraphTraits()

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

Definition at line 486 of file ICFG.cpp.

486 :
488 {
489 }
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

Member Function Documentation

◆ getEdgeAttributes()

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

Definition at line 554 of file ICFG.cpp.

555 {
556 ICFGEdge* edge = *(EI.getCurrent());
557 assert(edge && "No edge found!!");
558 if (SVFUtil::isa<CallCFGEdge>(edge))
559 return "style=solid,color=red";
560 else if (SVFUtil::isa<RetCFGEdge>(edge))
561 return "style=solid,color=blue";
562 else
563 return "style=solid";
564 return "";
565 }

◆ getEdgeSourceLabel()

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

Definition at line 568 of file ICFG.cpp.

569 {
570 ICFGEdge* edge = *(EI.getCurrent());
571 assert(edge && "No edge found!!");
572
573 std::string str;
574 std::stringstream rawstr(str);
575 if (CallCFGEdge* dirCall = SVFUtil::dyn_cast<CallCFGEdge>(edge))
576 rawstr << dirCall->getSrcNode();
577 else if (RetCFGEdge* dirRet = SVFUtil::dyn_cast<RetCFGEdge>(edge))
578 {
579 if(RetICFGNode* ret = SVFUtil::dyn_cast<RetICFGNode>(dirRet->getDstNode()))
580 rawstr << ret->getCallICFGNode();
581 }
582
583 return rawstr.str();
584 }

◆ getGraphName()

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

Return name of the graph.

Definition at line 492 of file ICFG.cpp.

493 {
494 return "ICFG";
495 }

◆ getNodeAttributes()

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

Definition at line 516 of file ICFG.cpp.

517 {
518 std::string str;
519 std::stringstream rawstr(str);
520
521 if(SVFUtil::isa<IntraICFGNode>(node))
522 {
523 rawstr << "color=black";
524 }
525 else if(SVFUtil::isa<FunEntryICFGNode>(node))
526 {
527 rawstr << "color=yellow";
528 }
529 else if(SVFUtil::isa<FunExitICFGNode>(node))
530 {
531 rawstr << "color=green";
532 }
533 else if(SVFUtil::isa<CallICFGNode>(node))
534 {
535 rawstr << "color=red";
536 }
537 else if(SVFUtil::isa<RetICFGNode>(node))
538 {
539 rawstr << "color=blue";
540 }
541 else if(SVFUtil::isa<GlobalICFGNode>(node))
542 {
543 rawstr << "color=purple";
544 }
545 else
546 assert(false && "no such kind of node!!");
547
548 rawstr << "";
549
550 return rawstr.str();
551 }

◆ getNodeLabel()

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

Definition at line 497 of file ICFG.cpp.

498 {
499 return getSimpleNodeLabel(node, graph);
500 }
static std::string getSimpleNodeLabel(NodeType *node, ICFG *)
Return the label of an ICFG node.
Definition ICFG.cpp:503

◆ getSimpleNodeLabel()

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

Return the label of an ICFG node.

Definition at line 503 of file ICFG.cpp.

504 {
505 return node->toString();
506 }

◆ isNodeHidden()

static bool SVF::DOTGraphTraits< ICFG * >::isNodeHidden ( ICFGNode node,
ICFG  
)
inlinestatic

Definition at line 508 of file ICFG.cpp.

509 {
511 return false;
512 else
513 return node->getInEdges().empty() && node->getOutEdges().empty();
514 }
const GEdgeSetTy & getOutEdges() const
const GEdgeSetTy & getInEdges() const
static const Option< bool > ShowHiddenNode
Definition Options.h:228

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