157 assert(SVFUtil::isa<ValVar>(dstNode) &&
"dst not an value node?");
159 assert(SVFUtil::isa<ObjVar>(srcNode) &&
"src not an value node?");
161 assert(!SVFUtil::isa<ObjVar>(srcNode) &&
"src not an object node?");
167 if (edge.rfind(
"copy-", 0) == 0)
173 if (opType ==
"COPYVAL")
177 else if (opType ==
"ZEXT")
181 else if (opType ==
"SEXT")
185 else if (opType ==
"BITCAST")
189 else if (opType ==
"TRUNC")
193 else if (opType ==
"FPTRUNC")
197 else if (opType ==
"FPTOUI")
201 else if (opType ==
"FPTOSI")
205 else if (opType ==
"UITOFP")
209 else if (opType ==
"SITOFP")
213 else if (opType ==
"INTTOPTR")
217 else if (opType ==
"PTRTOINT")
223 assert(
false &&
"format not support, can not create such edge");
226 else if (edge ==
"load")
228 else if (edge ==
"store")
230 else if (edge ==
"gep")
232 else if (edge ==
"variant-gep")
234 else if (edge ==
"call")
235 pag->
addEdge(srcNode, dstNode,
new CallPE(srcNode, dstNode,
nullptr,
nullptr));
236 else if (edge ==
"ret")
237 pag->
addEdge(srcNode, dstNode,
new RetPE(srcNode, dstNode,
nullptr,
nullptr));
238 else if (edge ==
"cmp")
240 else if (edge ==
"binary-op")
242 else if (edge ==
"unary-op")
244 else if (edge ==
"phi")
245 assert(
false &&
"fix phi here!");
246 else if (edge ==
"select")
247 assert(
false &&
"fix select here!");
248 else if (edge ==
"branch")
250 assert(
false &&
"fix successors here!");
254 assert(
false &&
"format not support, can not create such edge");
NodeType * getGNode(NodeID id) const
Get a node.
bool addEdge(SVFVar *src, SVFVar *dst, SVFStmt *edge)
Add an edge into the graph.
GepStmt * addVariantGepStmt(NodeID src, NodeID dst, const AccessPath &ap)
Add Variant(Gep) edge.
CopyStmt * addCopyStmt(NodeID src, NodeID dst, CopyStmt::CopyKind type)
Add Copy edge.
LoadStmt * addLoadStmt(NodeID src, NodeID dst)
Add Load edge.
GepStmt * addNormalGepStmt(NodeID src, NodeID dst, const AccessPath &ap)
Add Offset(Gep) edge.
CmpStmt * addCmpStmt(NodeID op1, NodeID op2, NodeID dst, u32_t predict)
Add Copy edge.
AddrStmt * addAddrStmt(NodeID src, NodeID dst)
Add an edge into SVFIR.
UnaryOPStmt * addUnaryOPStmt(NodeID src, NodeID dst, u32_t opcode)
Add Unary edge.
BinaryOPStmt * addBinaryOPStmt(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
Add Copy edge.
StoreStmt * addStoreStmt(NodeID src, NodeID dst, const ICFGNode *val)
Add Store edge.