149{
150
151
154
157 if(edge=="addr")
159 else
161
162 if (edge == "addr")
163 {
164 pag->addAddrStmt(srcID, dstID);
165 }
166 if (edge.rfind("copy-", 0) == 0)
167 {
168
170 std::string opType = edge.substr(5);
171
172 if (opType == "COPYVAL")
173 {
175 }
176 else if (opType == "ZEXT")
177 {
179 }
180 else if (opType == "SEXT")
181 {
183 }
184 else if (opType == "BITCAST")
185 {
187 }
188 else if (opType == "TRUNC")
189 {
191 }
192 else if (opType == "FPTRUNC")
193 {
195 }
196 else if (opType == "FPTOUI")
197 {
199 }
200 else if (opType == "FPTOSI")
201 {
203 }
204 else if (opType == "UITOFP")
205 {
207 }
208 else if (opType == "SITOFP")
209 {
211 }
212 else if (opType == "INTTOPTR")
213 {
215 }
216 else if (opType == "PTRTOINT")
217 {
219 }
220 else
221 {
222 assert(false && "format not support, can not create such edge");
223 }
224 }
225 else if (edge == "load")
226 pag->addLoadStmt(srcID, dstID);
227 else if (edge == "store")
228 pag->addStoreStmt(srcID, dstID,
nullptr);
229 else if (edge == "gep")
230 pag->addNormalGepStmt(srcID, dstID, AccessPath(offsetOrCSId));
231 else if (edge == "variant-gep")
232 pag->addVariantGepStmt(srcID, dstID, AccessPath(offsetOrCSId));
233 else if (edge == "call")
235 else if (edge == "ret")
236 pag->addEdge(srcNode, dstNode,
new RetPE(srcNode, dstNode,
nullptr,
nullptr));
237 else if (edge == "cmp")
238 pag->addCmpStmt(srcID, dstID, dstID, dstID);
239 else if (edge == "binary-op")
240 pag->addBinaryOPStmt(srcID, dstID, dstID, dstID);
241 else if (edge == "unary-op")
242 pag->addUnaryOPStmt(srcID, dstID, dstID);
243 else if (edge == "phi")
244 assert(false && "fix phi here!");
245 else if (edge == "select")
246 assert(false && "fix select here!");
247 else if (edge == "branch")
248 {
249 assert(false && "fix successors here!");
250
251 }
252 else
253 assert(false && "format not support, can not create such edge");
254}
std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > cast(const Y &Val)
LLVM_NODISCARD bool isa(const Y &Val)