34using namespace SVFUtil;
49 outs() <<
"add edge from " << src->
getId() <<
" kind :"
164 if (SVFUtil::isa<ValVar>(node))
166 if(SVFUtil::isa<GepValVar>(node))
167 return "shape=hexagon";
168 else if (SVFUtil::isa<DummyValVar>(node))
169 return "shape=diamond";
173 else if (SVFUtil::isa<ObjVar>(node))
175 if(SVFUtil::isa<GepObjVar>(node))
176 return "shape=doubleoctagon";
177 else if(SVFUtil::isa<BaseObjVar>(node))
178 return "shape=box3d";
179 else if (SVFUtil::isa<DummyObjVar>(node))
182 return "shape=component";
184 else if (SVFUtil::isa<RetPN>(node))
186 return "shape=Mrecord";
188 else if (SVFUtil::isa<VarArgPN>(node))
190 return "shape=octagon";
194 assert(0 &&
"no such kind!!");
199 template<
class EdgeIter>
204 if (SVFUtil::isa<AddrStmt>(
edge))
206 return "color=green";
208 else if (SVFUtil::isa<CopyStmt>(
edge))
210 return "color=black";
212 else if (SVFUtil::isa<GepStmt>(
edge))
214 return "color=purple";
216 else if (SVFUtil::isa<StoreStmt>(
edge))
220 else if (SVFUtil::isa<LoadStmt>(
edge))
224 else if (SVFUtil::isa<PhiStmt>(
edge))
228 else if (SVFUtil::isa<SelectStmt>(
edge))
232 else if (SVFUtil::isa<CmpStmt>(
edge))
236 else if (SVFUtil::isa<BinaryOPStmt>(
edge))
240 else if (SVFUtil::isa<UnaryOPStmt>(
edge))
244 else if (SVFUtil::isa<BranchStmt>(
edge))
248 else if (SVFUtil::isa<TDForkPE>(
edge))
250 return "color=Turquoise";
252 else if (SVFUtil::isa<TDJoinPE>(
edge))
254 return "color=Turquoise";
256 else if (SVFUtil::isa<CallPE>(
edge))
258 return "color=black,style=dashed";
260 else if (SVFUtil::isa<RetPE>(
edge))
262 return "color=black,style=dotted";
265 assert(
false &&
"No such kind edge!!");
269 template<
class EdgeIter>
276 return calledge->getCallSite()->getSourceLoc();
280 return retedge->getCallSite()->getSourceLoc();
#define DBOUT(TYPE, X)
LLVM debug macros, define type of your DBUG model of each pass.
GEdgeSetTy::iterator iterator
static void WriteGraphToFile(SVF::OutStream &O, const std::string &GraphName, const GraphType >, bool simple=false)
SVFStmt * hasLabeledEdge(SVFVar *src, SVFVar *dst, SVFStmt::PEDGEK kind, const ICFGNode *cs)
void dump(std::string name)
Dump SVFIR.
void view()
View graph from the debugger.
SVFStmt::KindToSVFStmtMapTy KindToSVFStmtSetMap
SVFIR edge map containing all PAGEdges.
std::string getGraphName() const
Return graph name.
SymbolTableInfo * symInfo
bool addEdge(SVFVar *src, SVFVar *dst, SVFStmt *edge)
Add an edge into the graph.
SVFStmt * hasNonlabeledEdge(SVFVar *src, SVFVar *dst, SVFStmt::PEDGEK kind)
static const Option< bool > ShowHiddenNode
GNodeK getNodeKind() const
Get node kind.
NodeID getId() const
Get ID.
static GEdgeFlag makeEdgeFlagWithAddionalOpnd(GEdgeKind k, const SVFVar *var)
static GEdgeFlag makeEdgeFlagWithCallInst(GEdgeKind k, const ICFGNode *cs)
const std::string & getName() const
void addOutEdge(SVFStmt *outEdge)
void addInEdge(SVFStmt *inEdge)
add methods of the components
virtual const SVFFunction * getFunction() const
virtual bool isIsolatedNode() const
Whether this is an isolated node on the SVFIR graph.
virtual const std::string toString() const
static void releaseSymbolInfo()
std::ostream & outs()
Overwrite llvm::outs()
void ViewGraph(const GraphType &G, const std::string &name, bool ShortNames=false, GraphProgram::Name Program=GraphProgram::DOT)
llvm::IRBuilder IRBuilder
static std::string getEdgeAttributes(SVFVar *, EdgeIter EI, IRGraph *)
DOTGraphTraits(bool isSimple=false)
static std::string getGraphName(IRGraph *graph)
Return name of the graph.
static std::string getNodeLabel(SVFVar *node, IRGraph *)
static std::string getNodeAttributes(SVFVar *node, IRGraph *)
static bool isNodeHidden(SVFVar *node, IRGraph *)
NodeType::iterator ChildIteratorType
static std::string getEdgeSourceLabel(SVFVar *, EdgeIter EI)