327 if(
const Instruction* inst = SVFUtil::dyn_cast<Instruction>(curVal))
CmpPE * addCmpEdge(NodeID src, NodeID dst)
Add Copy edge.
const BasicBlock * getCurrentBB() const
void visitUnaryOperator(UnaryOperator &I)
llvm::StoreInst StoreInst
llvm::UnreachableInst UnreachableInst
llvm::ExtractElementInst ExtractElementInst
void visitResumeInst(ResumeInst &)
Instruction not that often.
NodeID getValueNode(const Value *V)
Get PAG Node according to LLVM value.
llvm::VACopyInst VACopyInst
void visitReturnInst(ReturnInst &I)
llvm::BranchInst BranchInst
NormalGepPE * addNormalGepEdge(NodeID src, NodeID dst, const LocationSet &ls)
Add Offset(Gep) edge.
llvm::UnaryOperator UnaryOperator
ICFG * getICFG()
Return ICFG.
TDJoinPE * addThreadJoinEdge(NodeID src, NodeID dst, const CallBlockNode *cs)
Add Thread join edge for parameter passing.
llvm::BasicBlock BasicBlock
CallPE * addCallPE(NodeID src, NodeID dst, const CallBlockNode *cs)
Add Call edge.
BinaryOPPE * addBinaryOPPE(NodeID src, NodeID dst)
Add Copy edge.
void visitExtractElementInst(ExtractElementInst &I)
llvm::GlobalVariable GlobalVariable
llvm::ResumeInst ResumeInst
void visitBinaryOperator(BinaryOperator &I)
const Value * curVal
Current Value during PAG construction when visiting the module.
CallPE * addCallEdge(NodeID src, NodeID dst, const CallBlockNode *cs)
Add Call edge.
llvm::BinaryOperator BinaryOperator
llvm::InsertElementInst InsertElementInst
llvm::CallBrInst CallBrInst
LLVMContext & getContext() const
NodeID getReturnNode(const SVFFunction *func) const
GetReturnNode - Return the unique node representing the return value of a function.
PAG * getPAG() const
Return PAG.
llvm::InsertValueInst InsertValueInst
NodeID addDummyValNode()
Add a dummy value/object node according to node ID (llvm value is null)
void setCurrentLocation(const Value *val, const BasicBlock *bb)
Set current basic block in order to keep track of control flow information.
void visitAtomicRMWInst(AtomicRMWInst &I)
void visitLoadInst(LoadInst &I)
StorePE * addStoreEdge(NodeID src, NodeID dst)
Add Store edge.
AddrPE * addAddrEdge(NodeID src, NodeID dst)
Add Address edge.
void initialiseNodes()
Initialize nodes and edges.
void visitExtractValueInst(ExtractValueInst &EVI)
void visitSwitchInst(SwitchInst &I)
CopyPE * addCopyEdge(NodeID src, NodeID dst)
Add Copy edge.
void visitSelectInst(SelectInst &I)
NodeID getObjectNode(const Value *V)
void visitCallInst(CallInst &I)
GepPE * addGepPE(NodeID src, NodeID dst, const LocationSet &ls, bool constGep)
Add Gep edge.
NodeID getReturnNode(const SVFFunction *func)
getReturnNode - Return the node representing the unique return value of a function.
PAGEdge * addBlackHoleAddrEdge(NodeID node)
void handleDirectCall(CallSite cs, const SVFFunction *F)
Handle direct call.
TDForkPE * addThreadForkEdge(NodeID src, NodeID dst, const CallBlockNode *cs)
Add Thread fork edge for parameter passing.
void visitFenceInst(FenceInst &I)
PAGEdge * addBlackHoleAddrPE(NodeID node)
Set a pointer points-to black hole (e.g. int2ptr)
llvm::ReturnInst ReturnInst
void visitVAEndInst(VAEndInst &I)
NodeID getVarargNode(const SVFFunction *func) const
getVarargNode - Return the unique node representing the variadic argument of a variadic function...
const Type * getBaseTypeAndFlattenedFields(Value *v, std::vector< LocationSet > &fields)
const Value * getCurrentValue() const
void handleIndCall(CallSite cs)
Handle indirect call.
IntraBlockNode * getIntraBlockNode(const Instruction *inst)
llvm::SelectInst SelectInst
llvm::ConstantPointerNull ConstantPointerNull
void visitInsertValueInst(InsertValueInst &I)
virtual PAG * build(SVFModule *svfModule)
Start building PAG here.
llvm::AtomicCmpXchgInst AtomicCmpXchgInst
llvm::Instruction Instruction
AddrPE * addAddrPE(NodeID src, NodeID dst)
Add Address edge.
void visitCastInst(CastInst &I)
virtual void handleExtCall(CallSite cs, const SVFFunction *F)
Handle external call.
void visitGlobal(SVFModule *svfModule)
Handle globals including (global variable and functions)
void sanityCheck()
Sanity check for PAG.
RetPE * addRetEdge(NodeID src, NodeID dst, const CallBlockNode *cs)
Add Return edge.
NodeID getNullPtr() const
bool computeGepOffset(const User *V, LocationSet &ls)
Compute offset of a gep instruction or gep constant expression.
CopyPE * addCopyPE(NodeID src, NodeID dst)
Add Copy edge.
NormalGepPE * addNormalGepPE(NodeID src, NodeID dst, const LocationSet &ls)
Add Offset(Gep) edge.
llvm::AllocaInst AllocaInst
LLVM Instructions.
NodeID getValueNode(const Value *V)
Get different kinds of node.
llvm::FenceInst FenceInst
llvm::VAStartInst VAStartInst
BinaryOPPE * addBinaryOPEdge(NodeID src, NodeID dst)
Add Copy edge.
void visitCallSite(CallSite cs)
void visitAtomicCmpXchgInst(AtomicCmpXchgInst &I)
void setCurrentBBAndValueForPAGEdge(PAGEdge *edge)
void visitStoreInst(StoreInst &I)
llvm::GetElementPtrInst GetElementPtrInst
NodeID getGepValNode(const Value *val, const LocationSet &ls, const Type *baseType, u32_t fieldidx)
VariantGepPE * addVariantGepPE(NodeID src, NodeID dst)
Add Variant(Gep) edge.
void visitFreezeInst(FreezeInst &I)
CmpPE * addCmpPE(NodeID src, NodeID dst)
Add Copy edge.
void visitVAStartInst(VAStartInst &I)
RetPE * addRetPE(NodeID src, NodeID dst, const CallBlockNode *cs)
Add Return edge.
void addComplexConsForExt(Value *D, Value *S, u32_t sz=0)
void InitialGlobal(const GlobalVariable *gvar, Constant *C, u32_t offset)
void visitBranchInst(BranchInst &I)
void visitInstruction(Instruction &)
Provide base case for our instruction visit.
void visitShuffleVectorInst(ShuffleVectorInst &I)
void visitGetElementPtrInst(GetElementPtrInst &I)
void processCE(const Value *val)
Process constant expression.
llvm::InvokeInst InvokeInst
llvm::SwitchInst SwitchInst
TDForkPE * addThreadForkPE(NodeID src, NodeID dst, const CallBlockNode *cs)
Add Thread fork edge for parameter passing.
static LLVMModuleSet * getLLVMModuleSet()
UnaryOPPE * addUnaryOPEdge(NodeID src, NodeID dst)
Add Unary edge.
llvm::LLVMContext LLVMContext
void visitVACopyInst(VACopyInst &I)
llvm::ShuffleVectorInst ShuffleVectorInst
void visitPHINode(PHINode &I)
NodeID addNullPtrNode()
Add NullPtr PAGNode.
VariantGepPE * addVariantGepEdge(NodeID src, NodeID dst)
Add Variant(Gep) edge.
virtual void visitAllocaInst(AllocaInst &AI)
Our visit overrides.
StorePE * addStorePE(NodeID src, NodeID dst, const IntraBlockNode *val)
Add Store edge.
void addGlobalBlackHoleAddrEdge(NodeID node, const ConstantExpr *int2Ptrce)
Add global black hole Address edge.
TDJoinPE * addThreadJoinPE(NodeID src, NodeID dst, const CallBlockNode *cs)
Add Thread join edge for parameter passing.
void visitCallBrInst(CallBrInst &I)
void visitInvokeInst(InvokeInst &II)
void addEdge(NodeID src, NodeID dst, PAGEdge::PEDGEK kind, Size_t offset=0, Instruction *cs=nullptr)
llvm::ExtractValueInst ExtractValueInst
llvm::VAEndInst VAEndInst
void visitCmpInst(CmpInst &I)
llvm::LandingPadInst LandingPadInst
LoadPE * addLoadEdge(NodeID src, NodeID dst)
Add Load edge.
llvm::FreezeInst FreezeInst
llvm::ConstantExpr ConstantExpr
void visitLandingPadInst(LandingPadInst &I)
GepPE * addGepEdge(NodeID src, NodeID dst, const LocationSet &ls, bool constGep)
Add Gep edge.
void visitInsertElementInst(InsertElementInst &I)
NodeID getObjectNode(const Value *V)
GetObject - Return the object node (stack/global/heap/function) according to a LLVM Value...
LoadPE * addLoadPE(NodeID src, NodeID dst)
Add Load edge.
void visitVAArgInst(VAArgInst &)
void visitUnreachableInst(UnreachableInst &)
NodeID getGlobalVarField(const GlobalVariable *gvar, u32_t offset)
NodeID getVarargNode(const SVFFunction *func)
getVarargNode - Return the node representing the unique variadic argument of a function.
UnaryOPPE * addUnaryOPPE(NodeID src, NodeID dst)
Add Unary edge.
virtual ~PAGBuilder()
Destructor.
llvm::VAArgInst VAArgInst
const BasicBlock * curBB
Current basic block during PAG construction when visiting the module.
llvm::AtomicRMWInst AtomicRMWInst