Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVFIRBuilder.h
Go to the documentation of this file.
1//===- SVFIRBuilder.h -- Building SVFIR-------------------------------------------//
2//
3// SVF: Static Value-Flow Analysis
4//
5// Copyright (C) <2013-2017> <Yulei Sui>
6//
7
8// This program is free software: you can redistribute it and/or modify
9// it under the terms of the GNU Affero General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU Affero General Public License for more details.
17
18// You should have received a copy of the GNU Affero General Public License
19// along with this program. If not, see <http://www.gnu.org/licenses/>.
20//
21//===----------------------------------------------------------------------===//
22
23/*
24 * SVFIRBuilder.h
25 *
26 * Created on: Nov 1, 2013
27 * Author: Yulei Sui
28 * Refactored on: Jan 25, 2024
29 * Author: Xiao Cheng, Yulei Sui
30 */
31
32#ifndef PAGBUILDER_H_
33#define PAGBUILDER_H_
34
35#include "SVFIR/SVFIR.h"
36#include "SVF-LLVM/BasicTypes.h"
38#include "SVF-LLVM/LLVMModule.h"
39#include "SVF-LLVM/LLVMUtil.h"
40
41namespace SVF
42{
43
47class SVFIRBuilder: public llvm::InstVisitor<SVFIRBuilder>
48{
49 friend class GraphDBSVFIRBuilder;
50
51private:
54 const Value* curVal;
55
56
60 using AggregateField = std::vector<unsigned>;
62 using AggregateFieldKey = std::pair<const Value*, AggregateField>;
65
67 std::vector<AggregateFieldKey>& operands);
69 NodeID& node);
70
131 {
133 std::map<AggregateField, AggregateCallField> fields;
134 };
139
141 void addAggregateCallFields(const CallInst* call);
143
144public:
151 {
152 }
153
155 virtual SVFIR* build();
156
158 SVFIR* getPAG() const
159 {
160 return pag;
161 }
162
163 void createFunObjVars();
164 void initFunObjVar();
165
167
168 void initialiseNodes();
170 void initialiseValVars();
171
172 void initSVFBasicBlock(const Function* func);
173
174 void initDomTree(FunObjVar* func, const Function* f);
175
177 APOffset offset = 0, Instruction* cs = nullptr);
178 // @}
179
181 void sanityCheck();
182
184
185 // GetValNode - Return the value node according to a LLVM Value.
187 {
188 // first handle gep edge if val if a constant expression
189 processCE(V);
190
191 // strip off the constant cast and return the value node
192 return llvmModuleSet()->getValueNode(V);
193 }
194
197 {
198 return llvmModuleSet()->getObjectNode(V);
199 }
200
203 {
204 return pag->getReturnNode(func);
205 }
206
209 {
210 return pag->getVarargNode(func);
211 }
213
214
216
217 // Instructions that cannot be folded away.
218 virtual void visitAllocaInst(AllocaInst &AI);
219 void visitPHINode(PHINode &I);
220 void visitStoreInst(StoreInst &I);
221 void visitLoadInst(LoadInst &I);
223 void visitCallInst(CallInst &I);
226 void visitCallSite(CallBase* cs);
228 void visitCastInst(CastInst &I);
240 // TerminatorInst and UnwindInst have been removed since llvm-8.0.0
241 // void visitTerminatorInst(TerminatorInst &TI) {}
242 // void visitUnwindInst(UnwindInst &I) { /*returns void*/}
243
246 void visitCmpInst(CmpInst &I);
247
254
259
261
277
279 void visitResumeInst(ResumeInst&) /*returns void*/
280 {
281 }
282 void visitUnreachableInst(UnreachableInst&) /*returns void*/
283 {
284 }
285 void visitFenceInst(FenceInst &I) /*returns void*/
286 {
288 }
297
300 {
301 // If a new instruction is added to LLVM that we don't handle.
302 // TODO: ignore here:
303 }
304 //}@
305
307 void updateCallGraph(CallGraph* callgraph);
308
309protected:
311
312 void visitGlobal();
314 u32_t offset);
317
319 void processCE(const Value* val);
320
322 u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, AccessPath& ap, APOffset idx);
323
325 bool computeGepOffset(const User *V, AccessPath& ap);
326
328 const Value* getBaseValueForExtArg(const Value* V);
329
331 void handleDirectCall(CallBase* cs, const Function *F);
332
334 void handleIndCall(CallBase* cs);
335
337
338 virtual const Type *getBaseTypeAndFlattenedFields(const Value *V, std::vector<AccessPath> &fields, const Value* szValue);
339 virtual void addComplexConsForExt(Value *D, Value *S, const Value* sz);
340 virtual void handleNondetArgStoreAtExtCall(const CallBase* cs, const CallICFGNode* callICFGNode);
341 virtual void handleExtCall(const CallBase* cs, const Function* callee);
343
345 inline void setCurrentLocation(const Value* val, const BasicBlock* bb)
346 {
347 curBB = (bb == nullptr? nullptr : llvmModuleSet()->getSVFBasicBlock(bb));
348 curVal = (val == nullptr ? nullptr: val);
349 }
350 inline void setCurrentLocation(const Value* val, const SVFBasicBlock* bb)
351 {
352 curBB = bb;
353 curVal = val;
354 }
355 inline const Value* getCurrentValue() const
356 {
357 return curVal;
358 }
359 inline const SVFBasicBlock* getCurrentBB() const
360 {
361 return curBB;
362 }
363
373
376 {
378 ConstantPointerNull* constNull = ConstantPointerNull::get(PointerType::getUnqual(cxt));
379 NodeID nullPtr = pag->addConstantNullPtrValNode(pag->getNullPtr(), nullptr, llvmModuleSet()->getSVFType(constNull->getType()));
383 return nullPtr;
384 }
385
386 NodeID getGepValVar(const Value* val, const AccessPath& ap, const SVFType* elementType);
387
389
391
397
400 {
401 if(AddrStmt *edge = pag->addAddrStmt(src, dst))
402 {
404 return edge;
405 }
406 return nullptr;
407 }
408
410 inline AddrStmt* addAddrWithStackArraySz(NodeID src, NodeID dst, llvm::AllocaInst& inst)
411 {
412 AddrStmt* edge = addAddrEdge(src, dst);
413 if (inst.getArraySize())
414 {
415 edge->addArrSize(pag->getGNode(getValueNode(inst.getArraySize())));
416 }
417 return edge;
418 }
419
421 inline AddrStmt* addAddrWithHeapSz(NodeID src, NodeID dst, const CallBase* cs)
422 {
423 // get name of called function
424 AddrStmt* edge = addAddrEdge(src, dst);
425
426 llvm::Function* calledFunc = cs->getCalledFunction();
427 std::string functionName;
428 if (calledFunc)
429 {
430 functionName = calledFunc->getName().str();
431 }
432 else
433 {
434 SVFUtil::writeWrnMsg("not support indirect call to add AddrStmt.\n");
435 }
436 if (functionName == "malloc")
437 {
438 if (cs->arg_size() > 0)
439 {
440 const llvm::Value* val = cs->getArgOperand(0);
441 edge->addArrSize(pag->getGNode(getValueNode(val)));
442 }
443 }
444 // Check if the function called is 'calloc' and process its arguments.
445 // e.g. "%5 = call i8* @calloc(1, 8)", edge should add two SVFValue (1 and 8)
446 else if (functionName == "calloc")
447 {
448 if (cs->arg_size() > 1)
449 {
450 edge->addArrSize(
451 pag->getGNode(getValueNode(cs->getArgOperand(0))));
452 edge->addArrSize(
453 pag->getGNode(getValueNode(cs->getArgOperand(1))));
454 }
455 }
456 else
457 {
458 if (cs->arg_size() > 0)
459 {
460 const llvm::Value* val = cs->getArgOperand(0);
461 edge->addArrSize(pag->getGNode(getValueNode(val)));
462 }
463 }
464 return edge;
465 }
466
468 {
469 if(CopyStmt *edge = pag->addCopyStmt(src, dst, kind))
470 {
472 return edge;
473 }
474 return nullptr;
475 }
476
478 {
479 // COPYVAL, ZEXT, SEXT, BITCAST, FPTRUNC, FPTOUI, FPTOSI, UITOFP, SITOFP, INTTOPTR, PTRTOINT
480 if (const Instruction* inst = SVFUtil::dyn_cast<Instruction>(val))
481 {
482 switch (inst->getOpcode())
483 {
484 case Instruction::ZExt:
485 return CopyStmt::ZEXT;
486 case Instruction::SExt:
487 return CopyStmt::SEXT;
488 case Instruction::BitCast:
489 return CopyStmt::BITCAST;
490 case Instruction ::Trunc:
491 return CopyStmt::TRUNC;
492 case Instruction::FPTrunc:
493 return CopyStmt::FPTRUNC;
494 case Instruction::FPToUI:
495 return CopyStmt::FPTOUI;
496 case Instruction::FPToSI:
497 return CopyStmt::FPTOSI;
498 case Instruction::UIToFP:
499 return CopyStmt::UITOFP;
500 case Instruction::SIToFP:
501 return CopyStmt::SITOFP;
502 case Instruction::IntToPtr:
503 return CopyStmt::INTTOPTR;
504 case Instruction::PtrToInt:
505 return CopyStmt::PTRTOINT;
506 default:
507 return CopyStmt::COPYVAL;
508 }
509 }
510 assert (false && "Unknown cast inst!");
511 abort();
512 }
513
515 inline void addPhiStmt(NodeID res, NodeID opnd, const ICFGNode* pred)
516 {
518 if(PhiStmt *edge = pag->addPhiStmt(res,opnd,pred))
520 }
522 inline void addSelectStmt(NodeID res, NodeID op1, NodeID op2, NodeID cond)
523 {
524 if(SelectStmt *edge = pag->addSelectStmt(res,op1,op2,cond))
526 }
534 inline void addBinaryOPEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
535 {
536 if(BinaryOPStmt *edge = pag->addBinaryOPStmt(op1, op2, dst, opcode))
538 }
540 inline void addUnaryOPEdge(NodeID src, NodeID dst, u32_t opcode)
541 {
542 if(UnaryOPStmt *edge = pag->addUnaryOPStmt(src, dst, opcode))
544 }
552 inline void addLoadEdge(NodeID src, NodeID dst)
553 {
554 if(LoadStmt *edge = pag->addLoadStmt(src, dst))
556 }
558 inline void addStoreEdge(NodeID src, NodeID dst)
559 {
560 ICFGNode* node;
561 if (const Instruction* inst = SVFUtil::dyn_cast<Instruction>(curVal))
562 node = llvmModuleSet()->getICFGNode(
563 SVFUtil::cast<Instruction>(inst));
564 else
565 node = nullptr;
566 if (StoreStmt* edge = pag->addStoreStmt(src, dst, node))
568 }
570 inline void addCallEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunEntryICFGNode* entry)
571 {
572 if (CallPE* edge = pag->addCallPE(src, dst, cs, entry))
574 }
576 inline void addRetEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunExitICFGNode* exit)
577 {
578 if (RetPE* edge = pag->addRetPE(src, dst, cs, exit))
580 }
582 inline void addGepEdge(NodeID src, NodeID dst, const AccessPath& ap, bool constGep)
583 {
584 if (GepStmt* edge = pag->addGepStmt(src, dst, ap, constGep))
586 }
588 inline void addNormalGepEdge(NodeID src, NodeID dst, const AccessPath& ap)
589 {
590 if (GepStmt* edge = pag->addNormalGepStmt(src, dst, ap))
592 }
594 inline void addVariantGepEdge(NodeID src, NodeID dst, const AccessPath& ap)
595 {
596 if (GepStmt* edge = pag->addVariantGepStmt(src, dst, ap))
598 }
600 inline void addThreadForkEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunEntryICFGNode* entry)
601 {
602 if (TDForkPE* edge = pag->addThreadForkPE(src, dst, cs, entry))
604 }
606 inline void addThreadJoinEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunExitICFGNode* exit)
607 {
608 if (TDJoinPE* edge = pag->addThreadJoinPE(src, dst, cs, exit))
610 }
612
614
615private:
620};
621
622} // End namespace SVF
623
624#endif /* PAGBUILDER_H_ */
buffer offset
Definition cJSON.cpp:1113
std::vector< std::pair< const ICFGNode *, s32_t > > SuccAndCondPairVec
NodeType * getGNode(NodeID id) const
Get a node.
NodeID getBlkPtr() const
Definition IRGraph.h:259
NodeID getNullPtr() const
Definition IRGraph.h:263
NodeID getReturnNode(const FunObjVar *func) const
GetReturnNode - Return the unique node representing the return value of a function.
Definition IRGraph.cpp:64
NodeID getVarargNode(const FunObjVar *func) const
getVarargNode - Return the unique node representing the variadic argument of a variadic function.
Definition IRGraph.cpp:71
NodeID getValueNode(const Value *V)
static LLVMModuleSet * getLLVMModuleSet()
Definition LLVMModule.h:137
SVFBasicBlock * getSVFBasicBlock(const BasicBlock *bb)
Definition LLVMModule.h:305
void addToSVFVar2LLVMValueMap(const Value *val, SVFValue *svfBaseNode)
ICFGNode * getICFGNode(const Instruction *inst)
Get a basic block ICFGNode.
NodeID getObjectNode(const Value *V)
LLVMContext & getContext() const
Definition LLVMModule.h:393
u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator *gepOp, DataLayout *dl, AccessPath &ap, APOffset idx)
Infer field index from byteoffset.
CopyStmt::CopyKind getCopyKind(const Value *val)
void sanityCheck()
Sanity check for SVFIR.
void visitLandingPadInst(LandingPadInst &I)
SVFIR * getPAG() const
Return SVFIR.
Map< AggregateFieldKey, NodeID > aggregateFieldNodes
Reuse the same scalar SVFIR node for repeated requests for a field.
void setCurrentLocation(const Value *val, const BasicBlock *bb)
Set current basic block in order to keep track of control flow information.
NodeID addNullPtrNode()
Add NullPtr PAGNode.
void visitLoadInst(LoadInst &I)
void addAggregateCallFields(const CallInst *call)
std::vector< unsigned > AggregateField
NodeID getVarargNode(const FunObjVar *func)
getVarargNode - Return the node representing the unique variadic argument of a function.
void addPhiStmt(NodeID res, NodeID opnd, const ICFGNode *pred)
Add Copy edge.
void updateCallGraph(CallGraph *callgraph)
connect PAG edges based on callgraph
void initSVFBasicBlock(const Function *func)
void addStoreEdge(NodeID src, NodeID dst)
Add Store edge.
AddrStmt * addAddrEdge(NodeID src, NodeID dst)
Add Address edge.
void visitInvokeInst(InvokeInst &II)
void handleDirectCall(CallBase *cs, const Function *F)
Handle direct call.
void addBinaryOPEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
Add Copy edge.
void visitCallInst(CallInst &I)
void addLoadEdge(NodeID src, NodeID dst)
Add Load edge.
virtual void handleExtCall(const CallBase *cs, const Function *callee)
void visitGetElementPtrInst(GetElementPtrInst &I)
void visitBranchInst(BranchInst &I)
virtual void visitAllocaInst(AllocaInst &AI)
Our visit overrides.
void addGepEdge(NodeID src, NodeID dst, const AccessPath &ap, bool constGep)
Add Gep edge.
void addCmpEdge(NodeID op1, NodeID op2, NodeID dst, u32_t predict)
Add Copy edge.
void visitInsertValueInst(InsertValueInst &I)
AddrStmt * addAddrWithHeapSz(NodeID src, NodeID dst, const CallBase *cs)
Add Address edge from ext call with args like "%5 = call i8* @malloc(i64 noundef 5)".
LLVMModuleSet * llvmModuleSet()
void visitStoreInst(StoreInst &I)
void visitVAStartInst(VAStartInst &)
void addThreadForkEdge(NodeID src, NodeID dst, const CallICFGNode *cs, const FunEntryICFGNode *entry)
Add Thread fork edge for parameter passing.
void addGlobalBlackHoleAddrEdge(NodeID node, const ConstantExpr *int2Ptrce)
Add global black hole Address edge.
NodeID getReturnNode(const FunObjVar *func)
getReturnNode - Return the node representing the unique return value of a function.
virtual ~SVFIRBuilder()
Destructor.
NodeID getObjectNode(const Value *V)
GetObject - Return the object node (stack/global/heap/function) according to a LLVM Value.
void visitCallSite(CallBase *cs)
void processCE(const Value *val)
Process constant expression.
void handleIndCall(CallBase *cs)
Handle indirect call.
const Value * curVal
Current Value during SVFIR construction when visiting the module.
void addSelectStmt(NodeID res, NodeID op1, NodeID op2, NodeID cond)
Add SelectStmt.
void addBranchStmt(NodeID br, NodeID cond, const BranchStmt::SuccAndCondPairVec &succs)
Add Branch statement.
virtual SVFIR * build()
Start building SVFIR here.
void visitCallBrInst(CallBrInst &I)
friend class GraphDBSVFIRBuilder
std::pair< const Value *, AggregateField > AggregateFieldKey
Identify a field by its LLVM value and path, rather than by its type alone.
void visitExtractValueInst(ExtractValueInst &EVI)
AccessPath getAccessPathFromBaseNode(NodeID nodeId)
const SVFBasicBlock * curBB
Current basic block during SVFIR construction when visiting the module.
void visitSwitchInst(SwitchInst &I)
The following implementation follows ICFGBuilder::processFunBody.
void visitFreezeInst(FreezeInst &I)
void visitFenceInst(FenceInst &I)
void addAggregateReturnStores(ReturnInst &inst)
const Value * getBaseValueForExtArg(const Value *V)
Get the base value of (i8* src and i8* dst) for external argument (e.g. memcpy(i8* dst,...
void initDomTree(FunObjVar *func, const Function *f)
void addRetEdge(NodeID src, NodeID dst, const CallICFGNode *cs, const FunExitICFGNode *exit)
Add Return edge.
void addBlackHoleAddrEdge(NodeID node)
SVFIRBuilder()
Constructor.
virtual void handleNondetArgStoreAtExtCall(const CallBase *cs, const CallICFGNode *callICFGNode)
void visitInstruction(Instruction &)
Provide base case for our instruction visit.
NodeID getDirectAccessFieldZeroValVar(const Value *ptr, const Type *accessTy)
void addNormalGepEdge(NodeID src, NodeID dst, const AccessPath &ap)
Add Offset(Gep) edge.
void visitResumeInst(ResumeInst &)
Instruction not that often.
void visitGlobal()
Handle globals including (global variable and functions)
void visitInsertElementInst(InsertElementInst &I)
void addUnaryOPEdge(NodeID src, NodeID dst, u32_t opcode)
Add Unary edge.
void visitVAEndInst(VAEndInst &)
void initialiseAggregateReturns()
const SVFBasicBlock * getCurrentBB() const
virtual const Type * getBaseTypeAndFlattenedFields(const Value *V, std::vector< AccessPath > &fields, const Value *szValue)
Handle external call.
void visitPHINode(PHINode &I)
CopyStmt * addCopyEdge(NodeID src, NodeID dst, CopyStmt::CopyKind kind)
bool getAggregateFieldOperands(const AggregateFieldKey &field, std::vector< AggregateFieldKey > &operands)
Describe one field definition without emitting any SVFIR statements.
bool getAggregateFieldNode(const Value *aggregate, const AggregateField &indices, NodeID &node)
void addCallEdge(NodeID src, NodeID dst, const CallICFGNode *cs, const FunEntryICFGNode *entry)
Add Call edge.
void setCurrentBBAndValueForPAGEdge(PAGEdge *edge)
void visitSelectInst(SelectInst &I)
void visitVAArgInst(VAArgInst &)
void visitAtomicCmpXchgInst(AtomicCmpXchgInst &I)
void addEdge(NodeID src, NodeID dst, SVFStmt::PEDGEK kind, APOffset offset=0, Instruction *cs=nullptr)
void visitCmpInst(CmpInst &I)
void visitExtractElementInst(ExtractElementInst &I)
bool computeGepOffset(const User *V, AccessPath &ap)
Compute offset of a gep instruction or gep constant expression.
void visitReturnInst(ReturnInst &I)
const Value * getCurrentValue() const
void visitShuffleVectorInst(ShuffleVectorInst &I)
NodeID getValueNode(const Value *V)
Get different kinds of node.
void visitCastInst(CastInst &I)
Map< const Function *, std::map< AggregateField, NodeID > > aggregateReturnParams
Demanded field paths to output-parameter IDs, ordered per callee.
virtual void addComplexConsForExt(Value *D, Value *S, const Value *sz)
void setCurrentLocation(const Value *val, const SVFBasicBlock *bb)
AddrStmt * addAddrWithStackArraySz(NodeID src, NodeID dst, llvm::AllocaInst &inst)
Add Address edge from allocinst with arraysize like "%4 = alloca i8, i64 3".
void visitAtomicRMWInst(AtomicRMWInst &I)
NodeID getGepValVar(const Value *val, const AccessPath &ap, const SVFType *elementType)
void visitUnreachableInst(UnreachableInst &)
void InitialGlobal(const GlobalVariable *gvar, Constant *C, u32_t offset)
void visitUnaryOperator(UnaryOperator &I)
Map< const CallInst *, AggregateCall > aggregateCalls
All calls to a modeled callee, including calls with unused results.
void visitBinaryOperator(BinaryOperator &I)
void addThreadJoinEdge(NodeID src, NodeID dst, const CallICFGNode *cs, const FunExitICFGNode *exit)
Add Thread join edge for parameter passing.
void initialiseNodes()
Initialize nodes and edges.
NodeID getGlobalVarField(const GlobalVariable *gvar, u32_t offset, SVFType *tpy)
void addVariantGepEdge(NodeID src, NodeID dst, const AccessPath &ap)
Add Variant(Gep) edge.
void visitVACopyInst(VACopyInst &)
GepStmt * addVariantGepStmt(NodeID src, NodeID dst, const AccessPath &ap)
Add Variant(Gep) edge.
Definition SVFIR.cpp:465
CopyStmt * addCopyStmt(NodeID src, NodeID dst, CopyStmt::CopyKind type)
Add Copy edge.
Definition SVFIR.cpp:86
RetPE * addRetPE(NodeID src, NodeID dst, const CallICFGNode *cs, const FunExitICFGNode *exit)
Add Return edge.
Definition SVFIR.cpp:341
GepStmt * addGepStmt(NodeID src, NodeID dst, const AccessPath &ap, bool constGep)
Add Gep edge.
Definition SVFIR.cpp:419
SVFStmt * addBlackHoleAddrStmt(NodeID node)
Set a pointer points-to black hole (e.g. int2ptr)
Definition SVFIR.cpp:364
LoadStmt * addLoadStmt(NodeID src, NodeID dst)
Add Load edge.
Definition SVFIR.cpp:264
GepStmt * addNormalGepStmt(NodeID src, NodeID dst, const AccessPath &ap)
Add Offset(Gep) edge.
Definition SVFIR.cpp:438
CallPE * addCallPE(NodeID src, NodeID dst, const CallICFGNode *cs, const FunEntryICFGNode *entry)
Add Call edge (phi-like: merges actual params from all call sites into formal param)
Definition SVFIR.cpp:311
NodeID addConstantNullPtrValNode(const NodeID i, const ICFGNode *icfgNode, const SVFType *type)
Definition SVFIR.h:698
TDJoinPE * addThreadJoinPE(NodeID src, NodeID dst, const CallICFGNode *cs, const FunExitICFGNode *exit)
Add Thread join edge for parameter passing.
Definition SVFIR.cpp:399
CmpStmt * addCmpStmt(NodeID op1, NodeID op2, NodeID dst, u32_t predict)
Add Copy edge.
Definition SVFIR.cpp:168
AddrStmt * addAddrStmt(NodeID src, NodeID dst)
Add an edge into SVFIR.
Definition SVFIR.cpp:64
UnaryOPStmt * addUnaryOPStmt(NodeID src, NodeID dst, u32_t opcode)
Add Unary edge.
Definition SVFIR.cpp:218
TDForkPE * addThreadForkPE(NodeID src, NodeID dst, const CallICFGNode *cs, const FunEntryICFGNode *entry)
Add Thread fork edge for parameter passing.
Definition SVFIR.cpp:375
BinaryOPStmt * addBinaryOPStmt(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
Add Copy edge.
Definition SVFIR.cpp:194
StoreStmt * addStoreStmt(NodeID src, NodeID dst, const ICFGNode *val)
Add Store edge.
Definition SVFIR.cpp:288
PhiStmt * addPhiStmt(NodeID res, NodeID opnd, const ICFGNode *pred)
Add phi node information.
Definition SVFIR.cpp:109
SelectStmt * addSelectStmt(NodeID res, NodeID op1, NodeID op2, NodeID cond)
Add SelectStmt.
Definition SVFIR.cpp:142
BranchStmt * addBranchStmt(NodeID br, NodeID cond, const BranchStmt::SuccAndCondPairVec &succs)
Add BranchStmt.
Definition SVFIR.cpp:241
void writeWrnMsg(const std::string &msg)
Writes a message run through wrnMsg.
Definition SVFUtil.cpp:88
for isBitcode
Definition BasicTypes.h:70
llvm::DataLayout DataLayout
Definition BasicTypes.h:112
llvm::GlobalVariable GlobalVariable
Definition BasicTypes.h:137
llvm::VACopyInst VACopyInst
Definition BasicTypes.h:183
llvm::Type Type
Definition BasicTypes.h:87
llvm::CallBase CallBase
Definition BasicTypes.h:153
llvm::BasicBlock BasicBlock
Definition BasicTypes.h:90
llvm::UnaryOperator UnaryOperator
Definition BasicTypes.h:187
llvm::AllocaInst AllocaInst
Definition BasicTypes.h:157
llvm::SwitchInst SwitchInst
Definition BasicTypes.h:162
u32_t NodeID
Definition GeneralType.h:76
llvm::AtomicRMWInst AtomicRMWInst
Definition BasicTypes.h:159
llvm::InsertValueInst InsertValueInst
Definition BasicTypes.h:174
llvm::InvokeInst InvokeInst
Definition BasicTypes.h:170
llvm::AtomicCmpXchgInst AtomicCmpXchgInst
Definition BasicTypes.h:158
llvm::LoadInst LoadInst
Definition BasicTypes.h:156
s64_t APOffset
Definition GeneralType.h:80
llvm::CmpInst CmpInst
Definition BasicTypes.h:166
llvm::Function Function
Definition BasicTypes.h:89
llvm::FenceInst FenceInst
Definition BasicTypes.h:175
llvm::ShuffleVectorInst ShuffleVectorInst
Definition BasicTypes.h:171
llvm::InsertElementInst InsertElementInst
Definition BasicTypes.h:178
llvm::Instruction Instruction
Definition BasicTypes.h:91
llvm::Constant Constant
Definition BasicTypes.h:128
llvm::UnreachableInst UnreachableInst
Definition BasicTypes.h:177
llvm::ResumeInst ResumeInst
Definition BasicTypes.h:180
llvm::Value Value
LLVM Basic classes.
Definition BasicTypes.h:86
llvm::ConstantPointerNull ConstantPointerNull
Definition BasicTypes.h:131
llvm::ConstantExpr ConstantExpr
Definition BasicTypes.h:124
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76
llvm::CastInst CastInst
Definition BasicTypes.h:165
llvm::FreezeInst FreezeInst
Definition BasicTypes.h:176
llvm::BinaryOperator BinaryOperator
Definition BasicTypes.h:186
llvm::StoreInst StoreInst
Definition BasicTypes.h:155
llvm::SelectInst SelectInst
Definition BasicTypes.h:181
llvm::VAArgInst VAArgInst
Definition BasicTypes.h:182
llvm::GetElementPtrInst GetElementPtrInst
Definition BasicTypes.h:169
llvm::CallBrInst CallBrInst
Definition BasicTypes.h:163
llvm::ReturnInst ReturnInst
Definition BasicTypes.h:164
llvm::PHINode PHINode
Definition BasicTypes.h:172
llvm::BranchInst BranchInst
Definition BasicTypes.h:161
llvm::ExtractValueInst ExtractValueInst
Definition BasicTypes.h:167
unsigned u32_t
Definition GeneralType.h:67
llvm::VAStartInst VAStartInst
Definition BasicTypes.h:185
llvm::VAEndInst VAEndInst
Definition BasicTypes.h:184
llvm::CallInst CallInst
Definition BasicTypes.h:154
llvm::LandingPadInst LandingPadInst
Definition BasicTypes.h:179
llvm::ExtractElementInst ExtractElementInst
Definition BasicTypes.h:168
llvm::User User
Definition BasicTypes.h:149
llvm::LLVMContext LLVMContext
Definition BasicTypes.h:72
NodeID object
Pointer-sized return slot.
NodeID address
Output pointer passed to the callee.
NodeID value
Snapshot loaded at the continuation; used by extracts.
Continuation and field nodes for one call; see the example above.
std::map< AggregateField, AggregateCallField > fields
const Instruction * continuation