165 void dump(
const std::string& file,
bool simple =
false);
315 assert(
edge !=
nullptr &&
"Can not find inter value flow edge from aparam to fparam");
324 assert(
edge !=
nullptr &&
"Can not find inter value flow edge from fret to aret");
378 assert((
it->second == node->
getId()) &&
"a SVFIR node can only have unique definition ");
442 for(MemSSA::PHI::OPVers::const_iterator
it = opVerBegin,
eit=opVerEnd;
it!=
eit; ++
it)
const RetICFGNode * getRetICFGNode() const
Return callsite.
void addGNode(NodeID id, NodeType *node)
Add a Node.
u32_t nodeNum
total num of edge
FunEntryICFGNode * getFunEntryICFGNode(const SVFFunction *fun)
Add a function entry node.
FunExitICFGNode * getFunExitICFGNode(const SVFFunction *fun)
Add a function exit node.
StoreCHI< Condition > STORECHI
LoadMU< Condition > LOADMU
CallCHI< Condition > CALLCHI
EntryCHI< Condition > ENTRYCHI
CallMU< Condition > CALLMU
NodeID getId() const
Get ID.
virtual void buildSVFG()
Start building SVFG.
MemSSA::ENTRYCHI ENTRYCHI
void connectIndirectSVFGEdges()
Connect direct SVFG edges between two SVFG nodes (value-flow of top address-taken variables)
SVFGEdge * addThreadMHPIndirectVFEdge(NodeID srcId, NodeID dstId, const NodeBS &cpts)
bool hasSVFGNode(NodeID id) const
Whether has the SVFGNode.
ActualOUTSVFGNodeSet & getActualOUTSVFGNodes(const CallICFGNode *cs)
bool hasFormalOUTSVFGNodes(const SVFFunction *fun) const
bool hasActualINSVFGNodes(const CallICFGNode *cs) const
Has a SVFGNode.
bool hasFuncEntryChi(const SVFFunction *func) const
Has function for EntryCHI/RetMU/CallCHI/CallMU.
MemSSA * getMSSA() const
Get SVFG memory SSA.
Map< const PAGNode *, NodeID > PAGNodeToDefMapTy
Map< const SVFFunction *, FormalINSVFGNodeSet > FunctionToFormalINsMapTy
NodeBS ActualOUTSVFGNodeSet
bool hasFuncRetMu(const SVFFunction *func) const
SVFGStat * getStat() const
Return statistics.
CallSiteToActualOUTsMapTy callSiteToActualOUTMap
VFGNodeIDToNodeMapTy SVFGNodeIDToNodeMapTy
virtual void connectFOutAndAOut(const FormalOUTSVFGNode *formalOut, const ActualOUTSVFGNode *actualOut, CallSiteID csId, SVFGEdgeSetTy &edges)
Connect formal-out and actual-out.
void getInterVFEdgesForIndirectCallSite(const CallICFGNode *cs, const SVFFunction *callee, SVFGEdgeSetTy &edges)
Get all inter value flow edges of a indirect call site.
NodeID getDef(const MRVer *mvar) const
SVFGEdge * addInterIndirectVFCallEdge(const ActualINSVFGNode *src, const FormalINSVFGNode *dst, CallSiteID csId)
Add inter VF edge from callsite mu to function entry chi.
void connectFromGlobalToProgEntry()
Connect indirect SVFG edges from global initializers (store) to main function entry.
SVFGNode * getSVFGNode(NodeID id) const
Get a SVFG node.
void dump(const std::string &file, bool simple=false)
Dump graph into dot file.
void addIntraMSSAPHISVFGNode(ICFGNode *BlockICFGNode, const Map< u32_t, const MRVer * >::const_iterator opVerBegin, const Map< u32_t, const MRVer * >::const_iterator opVerEnd, const MRVer *resVer, const NodeID nodeId)
Add memory SSA PHI SVFG node.
ActualINSVFGNodeSet & getActualINSVFGNodes(const CallICFGNode *cs)
Get SVFGNode set.
bool hasFormalINSVFGNodes(const SVFFunction *fun) const
friend class TaintSVFGBuilder
friend class RcSvfgBuilder
bool addSVFGEdge(SVFGEdge *edge)
Add SVFG edge.
void removeSVFGNode(SVFGNode *node)
Remove a SVFGNode.
virtual ~SVFG()
Destructor.
Map< const CallICFGNode *, ActualINSVFGNodeSet > CallSiteToActualINsMapTy
void addActualOUTSVFGNode(const CallICFGNode *callsite, const MRVer *resVer, const NodeID nodeId)
Add memory callsite chi SVFG node.
FormalINSVFGNodeSet & getFormalINSVFGNodes(const SVFFunction *fun)
virtual void getInterVFEdgeAtIndCSFromFOutToAOut(ActualOUTSVFGNode *actualOut, const SVFFunction *callee, SVFGEdgeSetTy &edges)
Map< const CallICFGNode *, ActualOUTSVFGNodeSet > CallSiteToActualOUTsMapTy
virtual void writeToFile(const std::string &filename)
FunctionToFormalOUTsMapTy funToFormalOUTMap
void addFormalOUTSVFGNode(const FunExitICFGNode *funExit, const MRVer *ver, const NodeID nodeId)
Add memory Function return mu SVFG node.
void destroy()
Clean up memory.
bool hasCallSiteMu(const CallICFGNode *cs) const
const DummyVersionPropSVFGNode * addDummyVersionPropSVFGNode(const NodeID object, const NodeID version)
NodeBS FormalINSVFGNodeSet
virtual void addSVFGNode(SVFGNode *node, ICFGNode *icfgNode)
Add SVFG node.
SVFGEdge * addRetIndirectVFEdge(NodeID srcId, NodeID dstId, const NodeBS &cpts, CallSiteID csId)
virtual MRVer * getMRVERFromString(const std::string &input)
void addActualINSVFGNode(const CallICFGNode *callsite, const MRVer *ver, const NodeID nodeId)
Add memory callsite mu SVFG node.
bool hasDef(const PAGNode *pagNode) const
void removeSVFGEdge(SVFGEdge *edge)
Remove a SVFG edge.
const SVFGNode * getDefSVFGNode(const PAGNode *pagNode) const
Given a pagNode, return its definition site.
friend class DDASVFGBuilder
virtual void readFile(const std::string &filename)
void setDef(const MRVer *mvar, const SVFGNode *node)
Given a MSSADef, set/get its def SVFG node (definition of address-taken variables)
std::unique_ptr< MemSSA > mssa
NodeBS ActualINSVFGNodeSet
MSSAVarToDefMapTy MSSAVarToDefMap
map a memory SSA operator to its definition SVFG node
bool hasActualOUTSVFGNodes(const CallICFGNode *cs) const
virtual void getInterVFEdgeAtIndCSFromFRToAR(const PAGNode *fun_ret, const PAGNode *cs_ret, CallSiteID csId, SVFGEdgeSetTy &edges)
void addFormalINSVFGNode(const FunEntryICFGNode *funEntry, const MRVer *resVer, const NodeID nodeId)
Add memory Function entry chi SVFG node.
NodeID getDef(const PAGNode *pagNode) const
void addSVFGNodesForAddrTakenVars()
Create SVFG nodes for address-taken variables.
friend class MTASVFGBuilder
virtual void getInterVFEdgeAtIndCSFromAPToFP(const PAGNode *cs_arg, const PAGNode *fun_arg, const CallICFGNode *, CallSiteID csId, SVFGEdgeSetTy &edges)
Get inter value flow edges between indirect call site and callee.
Map< const SVFFunction *, FormalOUTSVFGNodeSet > FunctionToFormalOUTsMapTy
Map< const MRVer *, NodeID > MSSAVarToDefMapTy
u32_t getSVFGNodeNum() const
Return total SVFG node number.
SVFGEdge * addInterIndirectVFRetEdge(const FormalOUTSVFGNode *src, const ActualOUTSVFGNode *dst, CallSiteID csId)
Add inter VF edge from function exit mu to callsite chi.
virtual void connectAInAndFIn(const ActualINSVFGNode *actualIn, const FormalINSVFGNode *formalIn, CallSiteID csId, SVFGEdgeSetTy &edges)
Connect SVFG nodes between caller and callee for indirect call site.
NodeBS FormalOUTSVFGNodeSet
void setDef(const PAGNode *pagNode, const SVFGNode *node)
Given a PAGNode, set/get its def SVFG node (definition of top level pointers)
SVFGEdge * addIntraIndirectVFEdge(NodeID srcId, NodeID dstId, const NodeBS &cpts)
Add indirect def-use edges of a memory region between two statements,.
MemSSA::STORECHI STORECHI
const CallICFGNode * isCallSiteRetSVFGNode(const SVFGNode *node) const
Whether a node is callsite return SVFGNode.
bool hasDefSVFGNode(const PAGNode *pagNode) const
Given a pagNode, return whether it has definition site.
bool hasCallSiteChi(const CallICFGNode *cs) const
void performStat()
Perform statistics.
FormalOUTSVFGNodeSet & getFormalOUTSVFGNodes(const SVFFunction *fun)
const SVFFunction * isFunEntrySVFGNode(const SVFGNode *node) const
Whether a node is function entry SVFGNode.
FunctionToFormalINsMapTy funToFormalINMap
void clearMSSA()
Clear MSSA.
virtual void connectCallerAndCallee(const CallICFGNode *cs, const SVFFunction *callee, SVFGEdgeSetTy &edges)
Connect SVFG nodes between caller and callee for indirect call site.
SVFGEdge * addCallIndirectVFEdge(NodeID srcId, NodeID dstId, const NodeBS &cpts, CallSiteID csId)
CallSiteToActualINsMapTy callSiteToActualINMap
virtual void getInterVFEdgeAtIndCSFromAInToFIn(ActualINSVFGNode *actualIn, const SVFFunction *callee, SVFGEdgeSetTy &edges)
PointerAnalysis * getPTA() const
Get Pointer Analysis.
VFGEdge::VFGEdgeSetTy::const_iterator const_iterator
void removeVFGNode(VFGNode *node)
Remove a VFGNode.
void setDef(const PAGNode *pagNode, const VFGNode *node)
Given a PAGNode, set/get its def VFG node (definition of top level pointers)
bool hasVFGNode(NodeID id) const
Whether has the VFGNode.
NodeID getDef(const PAGNode *pagNode) const
bool addVFGEdge(VFGEdge *edge)
Add VFG edge.
VFGNode * getVFGNode(NodeID id) const
Get a VFG node.
bool hasDef(const PAGNode *pagNode) const
VFGEdge::SVFGEdgeSetTy SVFGEdgeSetTy
OrderedMap< NodeID, VFGNode * > VFGNodeIDToNodeMapTy
VFGEdge * hasInterVFGEdge(VFGNode *src, VFGNode *dst, VFGEdge::VFGEdgeK kind, CallSiteID csId)
virtual void addVFGNode(VFGNode *vfgNode, ICFGNode *icfgNode)
Add a VFG node.
void removeVFGEdge(VFGEdge *edge)
Remove a SVFG edge.
InterPHIVFGNode InterPHISVFGNode
ActualParmVFGNode ActualParmSVFGNode
StoreVFGNode StoreSVFGNode
ActualRetVFGNode ActualRetSVFGNode
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
llvm::IRBuilder IRBuilder
FormalParmVFGNode FormalParmSVFGNode
IntraPHIVFGNode IntraPHISVFGNode
FormalRetVFGNode FormalRetSVFGNode
NullPtrVFGNode NullPtrSVFGNode