Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions svf/include/Graphs/CDG.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,35 +420,35 @@ struct DOTGraphTraits<SVF::CDG *> : public DOTGraphTraits<SVF::PAG *>
std::stringstream rawstr(str);
const SVF::ICFGNode *icfgNode = node->getICFGNode();

rawstr << "shape=record";

if (SVF::SVFUtil::isa<SVF::IntraICFGNode>(icfgNode))
{
rawstr << "color=black";
rawstr << ",color=black";
}
else if (SVF::SVFUtil::isa<SVF::FunEntryICFGNode>(icfgNode))
{
rawstr << "color=yellow";
rawstr << ",color=yellow";
}
else if (SVF::SVFUtil::isa<SVF::FunExitICFGNode>(icfgNode))
{
rawstr << "color=green";
rawstr << ",color=green";
}
else if (SVF::SVFUtil::isa<SVF::CallICFGNode>(icfgNode))
{
rawstr << "color=red";
rawstr << ",color=red";
}
else if (SVF::SVFUtil::isa<SVF::RetICFGNode>(icfgNode))
{
rawstr << "color=blue";
rawstr << ",color=blue";
}
else if (SVF::SVFUtil::isa<SVF::GlobalICFGNode>(icfgNode))
{
rawstr << "color=purple";
rawstr << ",color=purple";
}
else
assert(false && "no such kind of node!!");

rawstr << "";

return rawstr.str();
}

Expand Down Expand Up @@ -479,4 +479,4 @@ struct DOTGraphTraits<SVF::CDG *> : public DOTGraphTraits<SVF::PAG *>
};

} // End namespace SVF
#endif //SVF_CONTROLDG_H
#endif //SVF_CONTROLDG_H
2 changes: 1 addition & 1 deletion svf/include/Graphs/GraphWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class GraphWriter
{
std::string NodeAttributes = DTraits.getNodeAttributes(Node, G);

O << "\tNode" << static_cast<const void*>(Node) << " [shape=record,";
O << "\tNode" << static_cast<const void*>(Node) << " [";
if (!NodeAttributes.empty()) O << NodeAttributes << ",";
O << "label=\"{";

Expand Down
2 changes: 1 addition & 1 deletion svf/lib/Graphs/CallGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ struct DOTGraphTraits<CallGraph*> : public DefaultDOTGraphTraits
const FunObjVar* fun = node->getFunction();
if (!SVFUtil::isExtCall(fun))
{
return "shape=box";
return "shape=record";
}
else
return "shape=Mrecord";
Expand Down
16 changes: 8 additions & 8 deletions svf/lib/Graphs/ICFG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,35 +516,35 @@ struct DOTGraphTraits<ICFG*> : public DOTGraphTraits<SVFIR*>
std::string str;
std::stringstream rawstr(str);

rawstr << "shape=record";

if(SVFUtil::isa<IntraICFGNode>(node))
{
rawstr << "color=black";
rawstr << ",color=black";
}
else if(SVFUtil::isa<FunEntryICFGNode>(node))
{
rawstr << "color=yellow";
rawstr << ",color=yellow";
}
else if(SVFUtil::isa<FunExitICFGNode>(node))
{
rawstr << "color=green";
rawstr << ",color=green";
}
else if(SVFUtil::isa<CallICFGNode>(node))
{
rawstr << "color=red";
rawstr << ",color=red";
}
else if(SVFUtil::isa<RetICFGNode>(node))
{
rawstr << "color=blue";
rawstr << ",color=blue";
}
else if(SVFUtil::isa<GlobalICFGNode>(node))
{
rawstr << "color=purple";
rawstr << ",color=purple";
}
else
assert(false && "no such kind of node!!");

rawstr << "";

return rawstr.str();
}

Expand Down
42 changes: 25 additions & 17 deletions svf/lib/Graphs/IRGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,71 +440,79 @@ struct DOTGraphTraits<IRGraph*> : public DefaultDOTGraphTraits
template<class EdgeIter>
static std::string getEdgeAttributes(SVFVar*, EdgeIter EI, IRGraph*)
{
std::string str;
std::stringstream rawstr(str);

rawstr << "shape=record";

const SVFStmt* edge = *(EI.getCurrent());
assert(edge && "No edge found!!");
if (SVFUtil::isa<AddrStmt>(edge))
{
return "color=green";
rawstr << ",color=green";
}
else if (SVFUtil::isa<CopyStmt>(edge))
{
return "color=black";
rawstr << ",color=black";
}
else if (SVFUtil::isa<GepStmt>(edge))
{
return "color=purple";
rawstr << ",color=purple";
}
else if (SVFUtil::isa<StoreStmt>(edge))
{
return "color=blue";
rawstr << ",color=blue";
}
else if (SVFUtil::isa<LoadStmt>(edge))
{
return "color=red";
rawstr << ",color=red";
}
else if (SVFUtil::isa<PhiStmt>(edge))
{
return "color=grey";
rawstr << ",color=grey";
}
else if (SVFUtil::isa<SelectStmt>(edge))
{
return "color=grey";
rawstr << ",color=grey";
}
else if (SVFUtil::isa<CmpStmt>(edge))
{
return "color=grey";
rawstr << ",color=grey";
}
else if (SVFUtil::isa<BinaryOPStmt>(edge))
{
return "color=grey";
rawstr << ",color=grey";
}
else if (SVFUtil::isa<UnaryOPStmt>(edge))
{
return "color=grey";
rawstr << ",color=grey";
}
else if (SVFUtil::isa<BranchStmt>(edge))
{
return "color=grey";
rawstr << ",color=grey";
}
else if (SVFUtil::isa<TDForkPE>(edge))
{
return "color=Turquoise";
rawstr << ",color=Turquoise";
}
else if (SVFUtil::isa<TDJoinPE>(edge))
{
return "color=Turquoise";
rawstr << ",color=Turquoise";
}
else if (SVFUtil::isa<CallPE>(edge))
{
return "color=black,style=dashed";
rawstr << ",color=black,style=dashed";
}
else if (SVFUtil::isa<RetPE>(edge))
{
return "color=black,style=dotted";
rawstr << ",color=black,style=dotted";
}
else
{
assert(false && "No such kind edge!!");
}

assert(false && "No such kind edge!!");
exit(1);
return rawstr.str();
}

template<class EdgeIter>
Expand Down
47 changes: 23 additions & 24 deletions svf/lib/Graphs/SVFG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,98 +1010,99 @@ struct DOTGraphTraits<SVFG*> : public DOTGraphTraits<SVFIR*>
std::string str;
std::stringstream rawstr(str);

rawstr << "shape=record";

if(StmtSVFGNode* stmtNode = SVFUtil::dyn_cast<StmtSVFGNode>(node))
{
const SVFStmt* edge = stmtNode->getSVFStmt();
if (SVFUtil::isa<AddrStmt>(edge))
{
rawstr << "color=green";
rawstr << ",color=green";
}
else if (SVFUtil::isa<CopyStmt>(edge))
{
rawstr << "color=black";
rawstr << ",color=black";
}
else if (SVFUtil::isa<RetPE>(edge))
{
rawstr << "color=black,style=dotted";
rawstr << ",color=black,style=dotted";
}
else if (SVFUtil::isa<GepStmt>(edge))
{
rawstr << "color=purple";
rawstr << ",color=purple";
}
else if (SVFUtil::isa<StoreStmt>(edge))
{
rawstr << "color=blue";
rawstr << ",color=blue";
}
else if (SVFUtil::isa<LoadStmt>(edge))
{
rawstr << "color=red";
rawstr << ",color=red";
}
else
{
assert(0 && "No such kind edge!!");
}
rawstr << "";
}
else if(SVFUtil::isa<MSSAPHISVFGNode>(node))
{
rawstr << "color=black";
rawstr << ",color=black";
}
else if(SVFUtil::isa<PHISVFGNode>(node))
{
rawstr << "color=black";
rawstr << ",color=black";
}
else if(SVFUtil::isa<NullPtrSVFGNode>(node))
{
rawstr << "color=grey";
rawstr << ",color=grey";
}
else if(SVFUtil::isa<FormalINSVFGNode>(node))
{
rawstr << "color=yellow,penwidth=2";
rawstr << ",color=yellow,penwidth=2";
}
else if(SVFUtil::isa<FormalOUTSVFGNode>(node))
{
rawstr << "color=yellow,penwidth=2";
rawstr << ",color=yellow,penwidth=2";
}
else if(SVFUtil::isa<FormalParmSVFGNode>(node))
{
rawstr << "color=yellow,penwidth=2";
rawstr << ",color=yellow,penwidth=2";
}
else if(SVFUtil::isa<ActualINSVFGNode>(node))
{
rawstr << "color=yellow,penwidth=2";
rawstr << ",color=yellow,penwidth=2";
}
else if(SVFUtil::isa<ActualOUTSVFGNode>(node))
{
rawstr << "color=yellow,penwidth=2";
rawstr << ",color=yellow,penwidth=2";
}
else if(SVFUtil::isa<ActualParmSVFGNode>(node))
{
rawstr << "color=yellow,penwidth=2";
rawstr << ",color=yellow,penwidth=2";
}
else if (SVFUtil::isa<ActualRetSVFGNode>(node))
{
rawstr << "color=yellow,penwidth=2";
rawstr << ",color=yellow,penwidth=2";
}
else if (SVFUtil::isa<FormalRetSVFGNode>(node))
{
rawstr << "color=yellow,penwidth=2";
rawstr << ",color=yellow,penwidth=2";
}
else if (SVFUtil::isa<BinaryOPVFGNode>(node))
{
rawstr << "color=black,penwidth=2";
rawstr << ",color=black,penwidth=2";
}
else if (SVFUtil::isa<CmpVFGNode>(node))
{
rawstr << "color=black,penwidth=2";
rawstr << ",color=black,penwidth=2";
}
else if (SVFUtil::isa<UnaryOPVFGNode>(node))
{
rawstr << "color=black,penwidth=2";
rawstr << ",color=black,penwidth=2";
}
else if (SVFUtil::isa<BranchVFGNode>(node))
{
rawstr << "color=gold,penwidth=2";
rawstr << ",color=gold,penwidth=2";
}
else
assert(false && "no such kind of node!!");
Expand All @@ -1122,8 +1123,6 @@ struct DOTGraphTraits<SVFG*> : public DOTGraphTraits<SVFIR*>
else if(graph->getStat()->inForwardSlice(node))
rawstr << ",style=filled, fillcolor=gray";

rawstr << "";

return rawstr.str();
}

Expand Down
Loading
Loading