37using namespace SVFUtil;
100 assert(
false &&
"format not support, pls specify node type");
123 outs() <<
"format not supported, token count = "
125 assert(
false &&
"format not supported");
133 outs() <<
"Unable to open file\n";
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)
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")
236 else if (
edge ==
"ret")
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");
static u32_t gepNodeNumIndex
void incNodeNum()
Increase number of node/edge.
u32_t getTotalNodeNum() const
Get total number of node/edge.
NodeType * getGNode(NodeID id) const
Get a node.
void setNodeNumAfterPAGBuild(u32_t num)
bool addEdge(SVFVar *src, SVFVar *dst, SVFStmt *edge)
Add an edge into the graph.
void addEdge(NodeID nodeSrc, NodeID nodeDst, APOffset offset, std::string edge)
SVFIR * build()
Start building.
NodeID addFIObjNode(const MemObj *obj)
Add a field-insensitive node, this method can only invoked by getFIGepObjNode.
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.
const MemObj * addDummyMemObj(NodeID i, const SVFType *type)
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.
std::ostream & outs()
Overwrite llvm::outs()
llvm::IRBuilder IRBuilder