Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
SVF::SVFGOPT Class Reference

#include <SVFGOPT.h>

Inheritance diagram for SVF::SVFGOPT:
SVF::SVFG SVF::VFG SVF::GenericGraph< NodeTy, EdgeTy >

Public Member Functions

 SVFGOPT (std::unique_ptr< MemSSA > mssa, VFGK kind)
 Constructor.
 
 ~SVFGOPT () override=default
 Destructor.
 
void setTokeepActualOutFormalIn ()
 
void setTokeepAllSelfCycle ()
 
void setTokeepContextSelfCycle ()
 
void readAndOptSVFG (const std::string &filename)
 Optimised SVFG's aren't written in their optimised form; read full SVFG and optimise it.
 
void buildAndWriteSVFG (const std::string &filename)
 Optimised SVFG's shouldn't be written in their optimised form; writes the full SVFG to file before optimising.
 
- Public Member Functions inherited from SVF::SVFG
virtual ~SVFG ()
 Destructor.
 
SVFGStatgetStat () const
 Return statistics.
 
void clearMSSA ()
 Clear MSSA.
 
MemSSAgetMSSA () const
 Get SVFG memory SSA.
 
PointerAnalysisgetPTA () const
 Get Pointer Analysis.
 
SVFGNodegetSVFGNode (NodeID id) const
 Get a SVFG node.
 
bool hasSVFGNode (NodeID id) const
 Whether has the SVFGNode.
 
void getInterVFEdgesForIndirectCallSite (const CallICFGNode *cs, const FunObjVar *callee, SVFGEdgeSetTy &edges)
 Get all inter value flow edges of a indirect call site.
 
void dump (const std::string &file, bool simple=false)
 Dump graph into dot file.
 
virtual void connectCallerAndCallee (const CallICFGNode *cs, const FunObjVar *callee, SVFGEdgeSetTy &edges)
 Connect SVFG nodes between caller and callee for indirect call site.
 
const SVFGNodegetDefSVFGNode (const PAGNode *pagNode) const
 Given a pagNode, return its definition site.
 
bool hasDefSVFGNode (const PAGNode *pagNode) const
 Given a pagNode, return whether it has definition site.
 
void performStat ()
 Perform statistics.
 
bool hasActualINSVFGNodes (const CallICFGNode *cs) const
 Has a SVFGNode.
 
bool hasActualOUTSVFGNodes (const CallICFGNode *cs) const
 
bool hasFormalINSVFGNodes (const FunObjVar *fun) const
 
bool hasFormalOUTSVFGNodes (const FunObjVar *fun) const
 
ActualINSVFGNodeSetgetActualINSVFGNodes (const CallICFGNode *cs)
 Get SVFGNode set.
 
ActualOUTSVFGNodeSetgetActualOUTSVFGNodes (const CallICFGNode *cs)
 
FormalINSVFGNodeSetgetFormalINSVFGNodes (const FunObjVar *fun)
 
FormalOUTSVFGNodeSetgetFormalOUTSVFGNodes (const FunObjVar *fun)
 
const FunObjVarisFunEntrySVFGNode (const SVFGNode *node) const
 Whether a node is function entry SVFGNode.
 
const CallICFGNodeisCallSiteRetSVFGNode (const SVFGNode *node) const
 Whether a node is callsite return SVFGNode.
 
void removeSVFGEdge (SVFGEdge *edge)
 Remove a SVFG edge.
 
void removeSVFGNode (SVFGNode *node)
 Remove a SVFGNode.
 
bool addSVFGEdge (SVFGEdge *edge)
 Add SVFG edge.
 
u32_t getSVFGNodeNum () const
 Return total SVFG node number.
 
const DummyVersionPropSVFGNodeaddDummyVersionPropSVFGNode (const NodeID object, const NodeID version)
 
virtual void writeToFile (const std::string &filename)
 
virtual void readFile (const std::string &filename)
 
virtual MRVergetMRVERFromString (const std::string &input)
 
- Public Member Functions inherited from SVF::VFG
 VFG (CallGraph *callgraph, VFGK k=FULLSVFG)
 Constructor.
 
virtual ~VFG ()
 Destructor.
 
VFGK getKind () const
 Get VFG kind.
 
bool isPtrOnlySVFG () const
 Return true if this VFG only contains pointer related SVFGNodes for pointer analysis.
 
SVFIRgetPAG () const
 Return SVFIR.
 
CallGraphgetCallGraph () const
 Return PTACallGraph.
 
VFGNodegetVFGNode (NodeID id) const
 Get a VFG node.
 
bool hasVFGNode (NodeID id) const
 Whether has the VFGNode.
 
GlobalVFGNodeSetgetGlobalVFGNodes ()
 Return global stores.
 
VFGEdgegetIntraVFGEdge (const VFGNode *src, const VFGNode *dst, VFGEdge::VFGEdgeK kind)
 Get a SVFG edge according to src and dst.
 
void dump (const std::string &file, bool simple=false)
 Dump graph into dot file.
 
void view ()
 Dump graph into dot file.
 
void updateCallGraph (PointerAnalysis *pta)
 Update VFG based on pointer analysis results.
 
CallSiteID getCallSiteID (const CallICFGNode *cs, const FunObjVar *func) const
 Get callsite given a callsiteID.
 
const CallICFGNodegetCallSite (CallSiteID id) const
 
const VFGNodegetDefVFGNode (const PAGNode *pagNode) const
 Given a pagNode, return its definition site.
 
bool hasLHSTopLevPtr (const VFGNode *node) const
 
const PAGNodegetLHSTopLevPtr (const VFGNode *node) const
 
bool hasStmtVFGNode (const PAGEdge *pagEdge) const
 Existence checks for VFGNodes.
 
bool hasIntraPHIVFGNode (const PAGNode *pagNode) const
 
bool hasBinaryOPVFGNode (const PAGNode *pagNode) const
 
bool hasUnaryOPVFGNode (const PAGNode *pagNode) const
 
bool hasBranchVFGNode (const PAGNode *pagNode) const
 
bool hasCmpVFGNode (const PAGNode *pagNode) const
 
bool hasActualParmVFGNode (const PAGNode *aparm, const CallICFGNode *cs) const
 
bool hasActualRetVFGNode (const PAGNode *aret) const
 
bool hasFormalParmVFGNode (const PAGNode *fparm) const
 
bool hasFormalRetVFGNode (const PAGNode *fret) const
 
StmtVFGNodegetStmtVFGNode (const PAGEdge *pagEdge) const
 Get an VFGNode.
 
IntraPHIVFGNodegetIntraPHIVFGNode (const PAGNode *pagNode) const
 
BinaryOPVFGNodegetBinaryOPVFGNode (const PAGNode *pagNode) const
 
UnaryOPVFGNodegetUnaryOPVFGNode (const PAGNode *pagNode) const
 
BranchVFGNodegetBranchVFGNode (const PAGNode *pagNode) const
 
CmpVFGNodegetCmpVFGNode (const PAGNode *pagNode) const
 
ActualParmVFGNodegetActualParmVFGNode (const PAGNode *aparm, const CallICFGNode *cs) const
 
ActualRetVFGNodegetActualRetVFGNode (const PAGNode *aret) const
 
FormalParmVFGNodegetFormalParmVFGNode (const PAGNode *fparm) const
 
FormalRetVFGNodegetFormalRetVFGNode (const PAGNode *fret) const
 
const FunObjVarisFunEntryVFGNode (const VFGNode *node) const
 Whether a node is function entry VFGNode.
 
bool hasBlackHoleConstObjAddrAsDef (const PAGNode *pagNode) const
 Whether a PAGNode has a blackhole or const object as its definition.
 
VFGEdgeaddIntraDirectVFEdge (NodeID srcId, NodeID dstId)
 
VFGEdgeaddCallEdge (NodeID srcId, NodeID dstId, CallSiteID csId)
 
VFGEdgeaddRetEdge (NodeID srcId, NodeID dstId, CallSiteID csId)
 
void removeVFGEdge (VFGEdge *edge)
 Remove a SVFG edge.
 
void removeVFGNode (VFGNode *node)
 Remove a VFGNode.
 
VFGEdgehasIntraVFGEdge (VFGNode *src, VFGNode *dst, VFGEdge::VFGEdgeK kind)
 Whether we has a SVFG edge.
 
VFGEdgehasInterVFGEdge (VFGNode *src, VFGNode *dst, VFGEdge::VFGEdgeK kind, CallSiteID csId)
 
VFGEdgehasThreadVFGEdge (VFGNode *src, VFGNode *dst, VFGEdge::VFGEdgeK kind)
 
bool addVFGEdge (VFGEdge *edge)
 Add VFG edge.
 
VFGNodeSetgetVFGNodes (const FunObjVar *fun)
 
bool hasVFGNodes (const FunObjVar *fun) const
 
bool VFGNodes (const FunObjVar *fun) const
 
VFGNodeSet::const_iterator getVFGNodeBegin (const FunObjVar *fun) const
 
VFGNodeSet::const_iterator getVFGNodeEnd (const FunObjVar *fun) const
 
- Public Member Functions inherited from SVF::GenericGraph< NodeTy, EdgeTy >
 GenericGraph ()
 Constructor.
 
virtual ~GenericGraph ()
 Destructor.
 
void destroy ()
 Release memory.
 
iterator begin ()
 Iterators.
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
void addGNode (NodeID id, NodeType *node)
 Add a Node.
 
NodeTypegetGNode (NodeID id) const
 Get a node.
 
bool hasGNode (NodeID id) const
 Has a node.
 
void removeGNode (NodeType *node)
 Delete a node.
 
u32_t getTotalNodeNum () const
 Get total number of node/edge.
 
u32_t getTotalEdgeNum () const
 
void incNodeNum ()
 Increase number of node/edge.
 
void incEdgeNum ()
 

Protected Member Functions

void buildSVFG () override
 Start building SVFG.
 
void optimiseSVFG ()
 Separate optimisation function to avoid duplicate code.
 
void connectAParamAndFParam (const PAGNode *cs_arg, const PAGNode *fun_arg, const CallICFGNode *, CallSiteID csId, SVFGEdgeSetTy &edges) override
 Connect SVFG nodes between caller and callee for indirect call sites.
 
void connectFRetAndARet (const PAGNode *fun_ret, const PAGNode *cs_ret, CallSiteID csId, SVFGEdgeSetTy &edges) override
 Connect formal-ret and actual ret.
 
void connectAInAndFIn (const ActualINSVFGNode *actualIn, const FormalINSVFGNode *formalIn, CallSiteID csId, SVFGEdgeSetTy &edges) override
 Connect actual-in and formal-in.
 
void connectFOutAndAOut (const FormalOUTSVFGNode *formalOut, const ActualOUTSVFGNode *actualOut, CallSiteID csId, SVFGEdgeSetTy &edges) override
 Connect formal-out and actual-out.
 
NodeID getActualINDef (NodeID ai) const
 Get def-site of actual-in/formal-out.
 
NodeID getFormalOUTDef (NodeID fo) const
 
- Protected Member Functions inherited from SVF::SVFG
void destroy ()
 Clean up memory.
 
 SVFG (std::unique_ptr< MemSSA > mssa, VFGK k)
 Constructor.
 
SVFGEdgeaddIntraIndirectVFEdge (NodeID srcId, NodeID dstId, const NodeBS &cpts)
 Add indirect def-use edges of a memory region between two statements,.
 
SVFGEdgeaddCallIndirectVFEdge (NodeID srcId, NodeID dstId, const NodeBS &cpts, CallSiteID csId)
 
SVFGEdgeaddRetIndirectVFEdge (NodeID srcId, NodeID dstId, const NodeBS &cpts, CallSiteID csId)
 
SVFGEdgeaddThreadMHPIndirectVFEdge (NodeID srcId, NodeID dstId, const NodeBS &cpts)
 
SVFGEdgeaddInterIndirectVFCallEdge (const ActualINSVFGNode *src, const FormalINSVFGNode *dst, CallSiteID csId)
 Add inter VF edge from callsite mu to function entry chi.
 
SVFGEdgeaddInterIndirectVFRetEdge (const FormalOUTSVFGNode *src, const ActualOUTSVFGNode *dst, CallSiteID csId)
 Add inter VF edge from function exit mu to callsite chi.
 
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.
 
virtual void getInterVFEdgeAtIndCSFromFRToAR (const PAGNode *fun_ret, const PAGNode *cs_ret, CallSiteID csId, SVFGEdgeSetTy &edges)
 
virtual void getInterVFEdgeAtIndCSFromAInToFIn (ActualINSVFGNode *actualIn, const FunObjVar *callee, SVFGEdgeSetTy &edges)
 
virtual void getInterVFEdgeAtIndCSFromFOutToAOut (ActualOUTSVFGNode *actualOut, const FunObjVar *callee, SVFGEdgeSetTy &edges)
 
void setDef (const PAGNode *pagNode, const SVFGNode *node)
 Given a PAGNode, set/get its def SVFG node (definition of top level pointers)
 
NodeID getDef (const PAGNode *pagNode) const
 
bool hasDef (const PAGNode *pagNode) const
 
void setDef (const MRVer *mvar, const SVFGNode *node)
 Given a MSSADef, set/get its def SVFG node (definition of address-taken variables)
 
NodeID getDef (const MRVer *mvar) const
 
void addSVFGNodesForAddrTakenVars ()
 Create SVFG nodes for address-taken variables.
 
void connectIndirectSVFGEdges ()
 Connect direct SVFG edges between two SVFG nodes (value-flow of top address-taken variables)
 
void connectFromGlobalToProgEntry ()
 Connect indirect SVFG edges from global initializers (store) to main function entry.
 
virtual void addSVFGNode (SVFGNode *node, ICFGNode *icfgNode)
 Add SVFG node.
 
void addFormalINSVFGNode (const FunEntryICFGNode *funEntry, const MRVer *resVer, const NodeID nodeId)
 Add memory Function entry chi SVFG node.
 
void addFormalOUTSVFGNode (const FunExitICFGNode *funExit, const MRVer *ver, const NodeID nodeId)
 Add memory Function return mu SVFG node.
 
void addActualINSVFGNode (const CallICFGNode *callsite, const MRVer *ver, const NodeID nodeId)
 Add memory callsite mu SVFG node.
 
void addActualOUTSVFGNode (const CallICFGNode *callsite, const MRVer *resVer, const NodeID nodeId)
 Add memory callsite chi SVFG node.
 
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.
 
bool hasFuncEntryChi (const FunObjVar *func) const
 Has function for EntryCHI/RetMU/CallCHI/CallMU.
 
bool hasFuncRetMu (const FunObjVar *func) const
 
bool hasCallSiteChi (const CallICFGNode *cs) const
 
bool hasCallSiteMu (const CallICFGNode *cs) const
 
- Protected Member Functions inherited from SVF::VFG
void destroy ()
 Clean up memory.
 
void checkIntraEdgeParents (const VFGNode *srcNode, const VFGNode *dstNode)
 sanitize Intra edges, verify that both nodes belong to the same function.
 
VFGEdgeaddInterEdgeFromAPToFP (ActualParmVFGNode *src, FormalParmVFGNode *dst, CallSiteID csId)
 Add inter VF edge from actual to formal parameters.
 
VFGEdgeaddInterEdgeFromFRToAR (FormalRetVFGNode *src, ActualRetVFGNode *dst, CallSiteID csId)
 Add inter VF edge from callee return to callsite receive parameter.
 
VFGEdgeaddInterEdgeFromAPToFP (NodeID src, NodeID dst, CallSiteID csId)
 Add inter VF edge from actual to formal parameters.
 
VFGEdgeaddInterEdgeFromFRToAR (NodeID src, NodeID dst, CallSiteID csId)
 Add inter VF edge from callee return to callsite receive parameter.
 
void setDef (const PAGNode *pagNode, const VFGNode *node)
 Given a PAGNode, set/get its def VFG node (definition of top level pointers)
 
NodeID getDef (const PAGNode *pagNode) const
 
bool hasDef (const PAGNode *pagNode) const
 
void addVFGNodes ()
 Create VFG nodes.
 
virtual SVFStmt::SVFStmtSetTygetPAGEdgeSet (SVFStmt::PEDGEK kind)
 Get PAGEdge set.
 
virtual bool isInterestedPAGNode (const SVFVar *node) const
 
void connectDirectVFGEdges ()
 Create edges between VFG nodes within a function.
 
void addVFGInterEdges (const CallICFGNode *cs, const FunObjVar *callee)
 Create edges between VFG nodes across functions.
 
bool isPhiCopyEdge (const PAGEdge *copy) const
 
virtual void addVFGNode (VFGNode *vfgNode, ICFGNode *icfgNode)
 Add a VFG node.
 
void addStmtVFGNode (StmtVFGNode *node, const PAGEdge *pagEdge)
 Add a VFG node for program statement.
 
void addNullPtrVFGNode (const PAGNode *pagNode)
 
void addAddrVFGNode (const AddrStmt *addr)
 Add an Address VFG node.
 
void addCopyVFGNode (const CopyStmt *copy)
 Add a Copy VFG node.
 
void addGepVFGNode (const GepStmt *gep)
 Add a Gep VFG node.
 
void addLoadVFGNode (const LoadStmt *load)
 Add a Load VFG node.
 
void addStoreVFGNode (const StoreStmt *store)
 
void addActualParmVFGNode (const PAGNode *aparm, const CallICFGNode *cs)
 
void addFormalParmVFGNode (const PAGNode *fparm, const FunObjVar *fun, CallPESet &callPEs)
 Add a formal parameter VFG node.
 
void addFormalRetVFGNode (const PAGNode *uniqueFunRet, const FunObjVar *fun, RetPESet &retPEs)
 
void addActualRetVFGNode (const PAGNode *ret, const CallICFGNode *cs)
 Add a callsite Receive VFG node.
 
void addIntraPHIVFGNode (const MultiOpndStmt *edge)
 Add an llvm PHI VFG node.
 
void addCmpVFGNode (const CmpStmt *edge)
 Add a Compare VFG node.
 
void addBinaryOPVFGNode (const BinaryOPStmt *edge)
 Add a BinaryOperator VFG node.
 
void addUnaryOPVFGNode (const UnaryOPStmt *edge)
 Add a UnaryOperator VFG node.
 
void addBranchVFGNode (const BranchStmt *edge)
 Add a BranchVFGNode.
 

Private Types

typedef Set< SVFGNode * > SVFGNodeSet
 
typedef Map< NodeID, NodeIDNodeIDToNodeIDMap
 
typedef FIFOWorkList< const MSSAPHISVFGNode * > WorkList
 

Private Member Functions

void parseSelfCycleHandleOption ()
 
SVFGEdgeaddCallIndirectSVFGEdge (NodeID srcId, NodeID dstId, CallSiteID csid, const NodeBS &cpts)
 Add inter-procedural value flow edge.
 
SVFGEdgeaddRetIndirectSVFGEdge (NodeID srcId, NodeID dstId, CallSiteID csid, const NodeBS &cpts)
 Add indirect ret edge from src to dst with one call site ID.
 
void handleInterValueFlow ()
 
void replaceFParamARetWithPHI (PHISVFGNode *phi, SVFGNode *svfgNode)
 Replace FormalParam/ActualRet node with PHI node.
 
void retargetEdgesOfAInFOut (SVFGNode *node)
 Retarget edges related to actual-in/-out and formal-in/-out.
 
void retargetEdgesOfAOutFIn (SVFGNode *node)
 Connect actual-out/formal-in's predecessors to their successors directly.
 
void handleIntraValueFlow ()
 Remove MSSAPHI SVFG nodes.
 
void initialWorkList ()
 Initial work list with MSSAPHI nodes which may be removed.
 
bool addIntoWorklist (const SVFGNode *node)
 
void bypassMSSAPHINode (const MSSAPHISVFGNode *node)
 Remove MSSAPHI node if possible.
 
bool checkSelfCycleEdges (const MSSAPHISVFGNode *node)
 Remove self cycle edges if needed. Return TRUE if some self cycle edges remained.
 
bool addNewSVFGEdge (NodeID srcId, NodeID dstId, const SVFGEdge *preEdge, const SVFGEdge *succEdge)
 Add new SVFG edge from src to dst.
 
bool bothInterEdges (const SVFGEdge *edge1, const SVFGEdge *edge2) const
 Return TRUE if both edges are indirect call/ret edges.
 
void addInterPHIOperands (PHISVFGNode *phi, const PAGNode *operand)
 
InterPHISVFGNodeaddInterPHIForFP (const FormalParmSVFGNode *fp)
 Add inter PHI SVFG node for formal parameter.
 
InterPHISVFGNodeaddInterPHIForAR (const ActualRetSVFGNode *ar)
 Add inter PHI SVFG node for actual return.
 
void resetDef (const PAGNode *pagNode, const SVFGNode *node)
 
bool isDefOfAInFOut (const SVFGNode *node)
 
bool actualInOfIndCS (const ActualINSVFGNode *ai) const
 Check if actual-in/actual-out exist at indirect call site.
 
bool actualOutOfIndCS (const ActualOUTSVFGNode *ao) const
 
bool formalInOfAddressTakenFunc (const FormalINSVFGNode *fi) const
 Check if formal-in/formal-out reside in address-taken function.
 
bool formalOutOfAddressTakenFunc (const FormalOUTSVFGNode *fo) const
 
bool isConnectingTwoCallSites (const SVFGNode *node) const
 Return TRUE if this node has both incoming call/ret and outgoing call/ret edges.
 
bool canBeRemoved (const SVFGNode *node)
 
void removeAllEdges (const SVFGNode *node)
 Remove edges of a SVFG node.
 
void removeInEdges (const SVFGNode *node)
 
void removeOutEdges (const SVFGNode *node)
 
void setActualINDef (NodeID ai, NodeID def)
 
void setFormalOUTDef (NodeID fo, NodeID def)
 

Private Attributes

NodeIDToNodeIDMap actualInToDefMap
 map actual-in to its def-site node
 
NodeIDToNodeIDMap formalOutToDefMap
 map formal-out to its def-site node
 
NodeBS defNodes
 preserved def nodes of formal-in/actual-out
 
WorkList worklist
 storing MSSAPHI nodes which may be removed.
 
bool keepActualOutFormalIn
 
bool keepAllSelfCycle
 
bool keepContextSelfCycle
 

Additional Inherited Members

- Public Types inherited from SVF::SVFG
typedef VFGNodeIDToNodeMapTy SVFGNodeIDToNodeMapTy
 
typedef Map< const PAGNode *, NodeIDPAGNodeToDefMapTy
 
typedef Map< const MRVer *, NodeIDMSSAVarToDefMapTy
 
typedef NodeBS ActualINSVFGNodeSet
 
typedef NodeBS ActualOUTSVFGNodeSet
 
typedef NodeBS FormalINSVFGNodeSet
 
typedef NodeBS FormalOUTSVFGNodeSet
 
typedef Map< const CallICFGNode *, ActualINSVFGNodeSetCallSiteToActualINsMapTy
 
typedef Map< const CallICFGNode *, ActualOUTSVFGNodeSetCallSiteToActualOUTsMapTy
 
typedef Map< const FunObjVar *, FormalINSVFGNodeSetFunctionToFormalINsMapTy
 
typedef Map< const FunObjVar *, FormalOUTSVFGNodeSetFunctionToFormalOUTsMapTy
 
typedef MemSSA::MUSet MUSet
 
typedef MemSSA::CHISet CHISet
 
typedef MemSSA::PHISet PHISet
 
typedef MemSSA::MU MU
 
typedef MemSSA::CHI CHI
 
typedef MemSSA::LOADMU LOADMU
 
typedef MemSSA::STORECHI STORECHI
 
typedef MemSSA::RETMU RETMU
 
typedef MemSSA::ENTRYCHI ENTRYCHI
 
typedef MemSSA::CALLCHI CALLCHI
 
typedef MemSSA::CALLMU CALLMU
 
- Public Types inherited from SVF::VFG
enum  VFGK { FULLSVFG , PTRONLYSVFG , FULLSVFG_OPT , PTRONLYSVFG_OPT }
 VFG kind. More...
 
typedef OrderedMap< NodeID, VFGNode * > VFGNodeIDToNodeMapTy
 
typedef Set< VFGNode * > VFGNodeSet
 
typedef Map< const PAGNode *, NodeIDPAGNodeToDefMapTy
 
typedef Map< std::pair< NodeID, const CallICFGNode * >, ActualParmVFGNode * > PAGNodeToActualParmMapTy
 
typedef Map< const PAGNode *, ActualRetVFGNode * > PAGNodeToActualRetMapTy
 
typedef Map< const PAGNode *, FormalParmVFGNode * > PAGNodeToFormalParmMapTy
 
typedef Map< const PAGNode *, FormalRetVFGNode * > PAGNodeToFormalRetMapTy
 
typedef Map< const PAGEdge *, StmtVFGNode * > PAGEdgeToStmtVFGNodeMapTy
 
typedef Map< const PAGNode *, IntraPHIVFGNode * > PAGNodeToPHIVFGNodeMapTy
 
typedef Map< const PAGNode *, BinaryOPVFGNode * > PAGNodeToBinaryOPVFGNodeMapTy
 
typedef Map< const PAGNode *, UnaryOPVFGNode * > PAGNodeToUnaryOPVFGNodeMapTy
 
typedef Map< const PAGNode *, BranchVFGNode * > PAGNodeToBranchVFGNodeMapTy
 
typedef Map< const PAGNode *, CmpVFGNode * > PAGNodeToCmpVFGNodeMapTy
 
typedef Map< const FunObjVar *, VFGNodeSetFunToVFGNodesMapTy
 
typedef FormalParmVFGNode::CallPESet CallPESet
 
typedef FormalRetVFGNode::RetPESet RetPESet
 
typedef VFGEdge::VFGEdgeSetTy VFGEdgeSetTy
 
typedef VFGEdge::SVFGEdgeSetTy SVFGEdgeSetTy
 
typedef VFGEdge::VFGEdgeSetTy::iterator VFGNodeIter
 
typedef VFGNodeIDToNodeMapTy::iterator iterator
 
typedef VFGNodeIDToNodeMapTy::const_iterator const_iterator
 
typedef SVFIR::SVFStmtSet SVFStmtSet
 
typedef Set< const VFGNode * > GlobalVFGNodeSet
 
typedef Set< const PAGNode * > PAGNodeSet
 
- Public Types inherited from SVF::GenericGraph< NodeTy, EdgeTy >
typedef NodeTy NodeType
 
typedef EdgeTy EdgeType
 
typedef OrderedMap< NodeID, NodeType * > IDToNodeMapTy
 NodeID to GenericNode map.
 
typedef IDToNodeMapTy::iterator iterator
 Node Iterators.
 
typedef IDToNodeMapTy::const_iterator const_iterator
 
- Public Attributes inherited from SVF::GenericGraph< NodeTy, EdgeTy >
u32_t edgeNum
 total num of node
 
u32_t nodeNum
 total num of edge
 
- Protected Attributes inherited from SVF::SVFG
MSSAVarToDefMapTy MSSAVarToDefMap
 map a memory SSA operator to its definition SVFG node
 
CallSiteToActualINsMapTy callSiteToActualINMap
 
CallSiteToActualOUTsMapTy callSiteToActualOUTMap
 
FunctionToFormalINsMapTy funToFormalINMap
 
FunctionToFormalOUTsMapTy funToFormalOUTMap
 
SVFGStatstat
 
std::unique_ptr< MemSSAmssa
 
PointerAnalysispta
 
- Protected Attributes inherited from SVF::VFG
NodeID totalVFGNode
 
PAGNodeToDefMapTy PAGNodeToDefMap
 map a pag node to its definition SVG node
 
PAGNodeToActualParmMapTy PAGNodeToActualParmMap
 map a PAGNode to an actual parameter
 
PAGNodeToActualRetMapTy PAGNodeToActualRetMap
 map a PAGNode to an actual return
 
PAGNodeToFormalParmMapTy PAGNodeToFormalParmMap
 map a PAGNode to a formal parameter
 
PAGNodeToFormalRetMapTy PAGNodeToFormalRetMap
 map a PAGNode to a formal return
 
PAGNodeToPHIVFGNodeMapTy PAGNodeToIntraPHIVFGNodeMap
 map a PAGNode to its PHIVFGNode
 
PAGNodeToBinaryOPVFGNodeMapTy PAGNodeToBinaryOPVFGNodeMap
 map a PAGNode to its BinaryOPVFGNode
 
PAGNodeToUnaryOPVFGNodeMapTy PAGNodeToUnaryOPVFGNodeMap
 map a PAGNode to its UnaryOPVFGNode
 
PAGNodeToBranchVFGNodeMapTy PAGNodeToBranchVFGNodeMap
 map a PAGNode to its BranchVFGNode
 
PAGNodeToCmpVFGNodeMapTy PAGNodeToCmpVFGNodeMap
 map a PAGNode to its CmpVFGNode
 
PAGEdgeToStmtVFGNodeMapTy PAGEdgeToStmtVFGNodeMap
 map a PAGEdge to its StmtVFGNode
 
FunToVFGNodesMapTy funToVFGNodesMap
 map a function to its VFGNodes;
 
GlobalVFGNodeSet globalVFGNodes
 set of global store VFG nodes
 
CallGraphcallgraph
 
SVFIRpag
 
VFGK kind
 
- Protected Attributes inherited from SVF::GenericGraph< NodeTy, EdgeTy >
IDToNodeMapTy IDToNodeMap
 node map
 

Detailed Description

Optimised SVFG.

  1. FormalParam/ActualRet is converted into Phi. ActualParam/FormalRet becomes the operands of Phi nodes created at callee/caller's entry/callsite.
  2. ActualIns/ActualOuts resides at direct call sites id removed. Sources of its incoming edges are connected with the destinations of its outgoing edges directly.
  3. FormalIns/FormalOuts reside at the entry/exit of non-address-taken functions is removed as ActualIn/ActualOuts.
  4. MSSAPHI nodes are removed if it have no self cycle. Otherwise depends on user option.

Definition at line 56 of file SVFGOPT.h.

Member Typedef Documentation

◆ NodeIDToNodeIDMap

Definition at line 59 of file SVFGOPT.h.

◆ SVFGNodeSet

Definition at line 58 of file SVFGOPT.h.

◆ WorkList

Definition at line 60 of file SVFGOPT.h.

Constructor & Destructor Documentation

◆ SVFGOPT()

SVF::SVFGOPT::SVFGOPT ( std::unique_ptr< MemSSA mssa,
VFGK  kind 
)
inline

Constructor.

Definition at line 64 of file SVFGOPT.h.

64 : SVFG(std::move(mssa), kind)
65 {
67 }
bool keepAllSelfCycle
Definition SVFGOPT.h:366
bool keepActualOutFormalIn
Definition SVFGOPT.h:365
bool keepContextSelfCycle
Definition SVFGOPT.h:367
SVFG(std::unique_ptr< MemSSA > mssa, VFGK k)
Constructor.
Definition SVFG.cpp:204
std::unique_ptr< MemSSA > mssa
Definition SVFG.h:106
VFGK kind
Definition VFG.h:105

◆ ~SVFGOPT()

SVF::SVFGOPT::~SVFGOPT ( )
overridedefault

Destructor.

Member Function Documentation

◆ actualInOfIndCS()

bool SVF::SVFGOPT::actualInOfIndCS ( const ActualINSVFGNode ai) const
inlineprivate

Check if actual-in/actual-out exist at indirect call site.

Definition at line 302 of file SVFGOPT.h.

303 {
304 return (SVFIR::getPAG()->isIndirectCallSites(ai->getCallSite()));
305 }
static SVFIR * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
Definition SVFIR.h:116
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ actualOutOfIndCS()

bool SVF::SVFGOPT::actualOutOfIndCS ( const ActualOUTSVFGNode ao) const
inlineprivate

Definition at line 306 of file SVFGOPT.h.

307 {
308 return (SVFIR::getPAG()->isIndirectCallSites(ao->getCallSite()));
309 }

◆ addCallIndirectSVFGEdge()

SVFGEdge * SVFGOPT::addCallIndirectSVFGEdge ( NodeID  srcId,
NodeID  dstId,
CallSiteID  csid,
const NodeBS cpts 
)
private

Add inter-procedural value flow edge.

Add indirect call edge from src to dst with one call site ID.

Definition at line 88 of file SVFGOPT.cpp.

89{
91 return addIntraIndirectVFEdge(srcId, dstId, cpts);
92 else
93 return addCallIndirectVFEdge(srcId, dstId, cpts, csid);
94}
static const Option< bool > ContextInsensitive
Definition Options.h:107
SVFGEdge * addIntraIndirectVFEdge(NodeID srcId, NodeID dstId, const NodeBS &cpts)
Add indirect def-use edges of a memory region between two statements,.
Definition SVFG.cpp:463
SVFGEdge * addCallIndirectVFEdge(NodeID srcId, NodeID dstId, const NodeBS &cpts, CallSiteID csId)
Definition SVFG.cpp:505

◆ addInterPHIForAR()

InterPHISVFGNode * SVF::SVFGOPT::addInterPHIForAR ( const ActualRetSVFGNode ar)
inlineprivate

Add inter PHI SVFG node for actual return.

Definition at line 261 of file SVFGOPT.h.

262 {
264 addSVFGNode(sNode, const_cast<RetICFGNode*>(
265 ar->getCallSite()->getRetICFGNode()));
266 resetDef(ar->getRev(),sNode);
267 return sNode;
268 }
void resetDef(const PAGNode *pagNode, const SVFGNode *node)
Definition SVFGOPT.h:270
virtual void addSVFGNode(SVFGNode *node, ICFGNode *icfgNode)
Add SVFG node.
Definition SVFG.h:397
NodeID totalVFGNode
Definition VFG.h:88
InterPHIVFGNode InterPHISVFGNode
Definition SVFG.h:58

◆ addInterPHIForFP()

InterPHISVFGNode * SVF::SVFGOPT::addInterPHIForFP ( const FormalParmSVFGNode fp)
inlineprivate

Add inter PHI SVFG node for formal parameter.

Definition at line 253 of file SVFGOPT.h.

254 {
257 resetDef(fp->getParam(),sNode);
258 return sNode;
259 }
FunEntryICFGNode * getFunEntryICFGNode(const FunObjVar *fun)
Add a function entry node.
Definition ICFG.cpp:242
ICFG * getICFG() const
Definition SVFIR.h:163
SVFIR * pag
Definition VFG.h:104

◆ addInterPHIOperands()

void SVF::SVFGOPT::addInterPHIOperands ( PHISVFGNode phi,
const PAGNode operand 
)
inlineprivate

Definition at line 247 of file SVFGOPT.h.

248 {
249 phi->setOpVer(phi->getOpVerNum(), operand);
250 }

◆ addIntoWorklist()

bool SVF::SVFGOPT::addIntoWorklist ( const SVFGNode node)
inlineprivate

Only MSSAPHI node which satisfy following conditions will be removed:

  1. it's not def-site of actual-in/formal-out;
  2. it doesn't have incoming and outgoing call/ret at the same time.

Definition at line 220 of file SVFGOPT.h.

221 {
222 if (const MSSAPHISVFGNode* phi = SVFUtil::dyn_cast<MSSAPHISVFGNode>(node))
223 {
224 if (isConnectingTwoCallSites(phi) == false && isDefOfAInFOut(phi) == false)
225 return worklist.push(phi);
226 }
227 return false;
228 }
bool push(const Data &data)
Definition WorkList.h:165
bool isDefOfAInFOut(const SVFGNode *node)
Definition SVFGOPT.h:295
WorkList worklist
storing MSSAPHI nodes which may be removed.
Definition SVFGOPT.h:363
bool isConnectingTwoCallSites(const SVFGNode *node) const
Return TRUE if this node has both incoming call/ret and outgoing call/ret edges.
Definition SVFGOPT.cpp:312

◆ addNewSVFGEdge()

bool SVFGOPT::addNewSVFGEdge ( NodeID  srcId,
NodeID  dstId,
const SVFGEdge preEdge,
const SVFGEdge succEdge 
)
private

Add new SVFG edge from src to dst.

Add new SVFG edge from src to dst. The edge's kind depends on preEdge and succEdge. Self-cycle edges may be added here.

Definition at line 543 of file SVFGOPT.cpp.

544{
545 assert(SVFUtil::isa<IndirectSVFGEdge>(preEdge) && SVFUtil::isa<IndirectSVFGEdge>(succEdge)
546 && "either pre or succ edge is not indirect SVFG edge");
547
548 const IndirectSVFGEdge* preIndEdge = SVFUtil::cast<IndirectSVFGEdge>(preEdge);
549 const IndirectSVFGEdge* succIndEdge = SVFUtil::cast<IndirectSVFGEdge>(succEdge);
550
551 NodeBS intersection = preIndEdge->getPointsTo();
552 intersection &= succIndEdge->getPointsTo();
553
554 if (intersection.empty())
555 return false;
556
557 assert(bothInterEdges(preEdge, succEdge) == false && "both edges are inter edges");
558
559 if (const CallIndSVFGEdge* preCallEdge = SVFUtil::dyn_cast<CallIndSVFGEdge>(preEdge))
560 {
561 return addCallIndirectSVFGEdge(srcId, dstId, preCallEdge->getCallSiteId(), intersection);
562 }
563 else if (const CallIndSVFGEdge* succCallEdge = SVFUtil::dyn_cast<CallIndSVFGEdge>(succEdge))
564 {
565 return addCallIndirectSVFGEdge(srcId, dstId, succCallEdge->getCallSiteId(), intersection);
566 }
567 else if (const RetIndSVFGEdge* preRetEdge = SVFUtil::dyn_cast<RetIndSVFGEdge>(preEdge))
568 {
569 return addRetIndirectSVFGEdge(srcId, dstId, preRetEdge->getCallSiteId(), intersection);
570 }
571 else if (const RetIndSVFGEdge* succRetEdge = SVFUtil::dyn_cast<RetIndSVFGEdge>(succEdge))
572 {
573 return addRetIndirectSVFGEdge(srcId, dstId, succRetEdge->getCallSiteId(), intersection);
574 }
575 else
576 {
578 }
579
580 return false;
581}
SVFGEdge * addCallIndirectSVFGEdge(NodeID srcId, NodeID dstId, CallSiteID csid, const NodeBS &cpts)
Add inter-procedural value flow edge.
Definition SVFGOPT.cpp:88
bool bothInterEdges(const SVFGEdge *edge1, const SVFGEdge *edge2) const
Return TRUE if both edges are indirect call/ret edges.
Definition SVFGOPT.h:240
SVFGEdge * addRetIndirectSVFGEdge(NodeID srcId, NodeID dstId, CallSiteID csid, const NodeBS &cpts)
Add indirect ret edge from src to dst with one call site ID.
Definition SVFGOPT.cpp:99

◆ addRetIndirectSVFGEdge()

SVFGEdge * SVFGOPT::addRetIndirectSVFGEdge ( NodeID  srcId,
NodeID  dstId,
CallSiteID  csid,
const NodeBS cpts 
)
private

Add indirect ret edge from src to dst with one call site ID.

Definition at line 99 of file SVFGOPT.cpp.

100{
102 return addIntraIndirectVFEdge(srcId, dstId, cpts);
103 else
104 return addRetIndirectVFEdge(srcId, dstId, cpts, csid);
105}
SVFGEdge * addRetIndirectVFEdge(NodeID srcId, NodeID dstId, const NodeBS &cpts, CallSiteID csId)
Definition SVFG.cpp:525

◆ bothInterEdges()

bool SVF::SVFGOPT::bothInterEdges ( const SVFGEdge edge1,
const SVFGEdge edge2 
) const
inlineprivate

Return TRUE if both edges are indirect call/ret edges.

Definition at line 240 of file SVFGOPT.h.

241 {
242 bool inter1 = SVFUtil::isa<CallIndSVFGEdge, RetIndSVFGEdge>(edge1);
243 bool inter2 = SVFUtil::isa<CallIndSVFGEdge, RetIndSVFGEdge>(edge2);
244 return (inter1 && inter2);
245 }

◆ buildAndWriteSVFG()

void SVFGOPT::buildAndWriteSVFG ( const std::string &  filename)

Optimised SVFG's shouldn't be written in their optimised form; writes the full SVFG to file before optimising.

Shouldn't write optimised SVFG to file; writes the built SVFG to file before optimisation.

Definition at line 54 of file SVFGOPT.cpp.

55{
59}
void optimiseSVFG()
Separate optimisation function to avoid duplicate code.
Definition SVFGOPT.cpp:68
virtual void buildSVFG()
Start building SVFG.
Definition SVFG.cpp:228
virtual void writeToFile(const std::string &filename)

◆ buildSVFG()

void SVFGOPT::buildSVFG ( )
overrideprotectedvirtual

Start building SVFG.

Build SVFG 1) build SVFG nodes a) statements for top level pointers (PAGEdges) b) operators of address-taken variables (MSSAPHI and MSSACHI) 2) connect SVFG edges a) between two statements (PAGEdges) b) between two memory SSA operators (MSSAPHI MSSAMU and MSSACHI)

Reimplemented from SVF::SVFG.

Definition at line 61 of file SVFGOPT.cpp.

62{
65}

◆ bypassMSSAPHINode()

void SVFGOPT::bypassMSSAPHINode ( const MSSAPHISVFGNode node)
private

Remove MSSAPHI node if possible.

Remove MSSAPHI node if possible

add new edges from predecessor to all successors.

if no new edge is added, the number of dst node's incoming edges may be decreased. try to analyze it again.

if no new edge is added, the number of src node's outgoing edges may be decreased. try to analyze it again.

Definition at line 500 of file SVFGOPT.cpp.

501{
504 for (; inEdgeIt != inEdgeEit; ++inEdgeIt)
505 {
506 const SVFGEdge* preEdge = *inEdgeIt;
507 const SVFGNode* srcNode = preEdge->getSrcNode();
508
509 bool added = false;
513 for (; outEdgeIt != outEdgeEit; ++outEdgeIt)
514 {
515 const SVFGEdge* succEdge = *outEdgeIt;
516 const SVFGNode* dstNode = (*outEdgeIt)->getDstNode();
517 if (srcNode->getId() != dstNode->getId()
518 && addNewSVFGEdge(srcNode->getId(), dstNode->getId(), preEdge, succEdge))
519 added = true;
520 else
521 {
525 }
526 }
527
528 if (added == false)
529 {
533 }
534 }
535
536 removeAllEdges(node);
537}
iterator OutEdgeEnd()
iterator OutEdgeBegin()
iterators
iterator InEdgeBegin()
iterator InEdgeEnd()
bool addNewSVFGEdge(NodeID srcId, NodeID dstId, const SVFGEdge *preEdge, const SVFGEdge *succEdge)
Add new SVFG edge from src to dst.
Definition SVFGOPT.cpp:543
bool addIntoWorklist(const SVFGNode *node)
Definition SVFGOPT.h:220
void removeAllEdges(const SVFGNode *node)
Remove edges of a SVFG node.
Definition SVFGOPT.h:340
VFGEdge::VFGEdgeSetTy::const_iterator const_iterator
Definition VFGNode.h:55

◆ canBeRemoved()

bool SVFGOPT::canBeRemoved ( const SVFGNode node)
private

Return TRUE if this SVFGNode can be removed. Nodes can be removed if it is:

  1. ActualParam/FormalParam/ActualRet/FormalRet
  2. ActualIN if it doesn't reside at indirect call site
  3. FormalIN if it doesn't reside at the entry of address-taken function and it's not definition site of ActualIN
  4. ActualOUT if it doesn't reside at indirect call site and it's not definition site of FormalOUT
  5. FormalOUT if it doesn't reside at the exit of address-taken function

Now each SVFG edge can only be associated with one call site id, so if this node has both incoming call/ret and outgoing call/ret edges, we don't remove this node.

Definition at line 354 of file SVFGOPT.cpp.

355{
358 return true;
361 {
365 if (isConnectingTwoCallSites(node))
366 return false;
367
368 if (const ActualINSVFGNode* ai = SVFUtil::dyn_cast<ActualINSVFGNode>(node))
369 {
370 return (actualInOfIndCS(ai) == false);
371 }
372 else if (const ActualOUTSVFGNode* ao = SVFUtil::dyn_cast<ActualOUTSVFGNode>(node))
373 {
374 return (actualOutOfIndCS(ao) == false && isDefOfAInFOut(node) == false);
375 }
376 else if (const FormalINSVFGNode* fi = SVFUtil::dyn_cast<FormalINSVFGNode>(node))
377 {
378 return (formalInOfAddressTakenFunc(fi) == false && isDefOfAInFOut(node) == false);
379 }
380 else if (const FormalOUTSVFGNode* fo = SVFUtil::dyn_cast<FormalOUTSVFGNode>(node))
381 {
382 return (formalOutOfAddressTakenFunc(fo) == false);
383 }
384 }
385
386 return false;
387}
bool formalInOfAddressTakenFunc(const FormalINSVFGNode *fi) const
Check if formal-in/formal-out reside in address-taken function.
Definition SVFGOPT.h:314
bool actualOutOfIndCS(const ActualOUTSVFGNode *ao) const
Definition SVFGOPT.h:306
bool formalOutOfAddressTakenFunc(const FormalOUTSVFGNode *fo) const
Definition SVFGOPT.h:318
bool actualInOfIndCS(const ActualINSVFGNode *ai) const
Check if actual-in/actual-out exist at indirect call site.
Definition SVFGOPT.h:302
LLVM_NODISCARD bool isa(const Y &Val)
Definition Casting.h:241

◆ checkSelfCycleEdges()

bool SVFGOPT::checkSelfCycleEdges ( const MSSAPHISVFGNode node)
private

Remove self cycle edges if needed. Return TRUE if some self cycle edges remained.

Remove self cycle edges according to specified options:

  1. keepAllSelfCycle = TRUE: all self cycle edges are kept;
  2. keepContextSelfCycle = TRUE: all self cycle edges related-to context are kept;
  3. Otherwise, all self cycle edges are NOT kept. Return TRUE if some self cycle edges remain in this node.

There's no need to check other edge if we do not remove self cycle

Continue checking and remove other self cycle which are NOT context-related

Definition at line 462 of file SVFGOPT.cpp.

463{
464 bool hasSelfCycle = false;
465
469 for (; inEdgeIt != inEdgeEit; ++inEdgeIt)
470 {
472
473 if (preEdge->getSrcID() == preEdge->getDstID())
474 {
476 {
477 hasSelfCycle = true;
478 break;
479 }
480 else if (keepContextSelfCycle &&
481 SVFUtil::isa<CallIndSVFGEdge, RetIndSVFGEdge>(preEdge))
482 {
483 hasSelfCycle = true;
484 continue;
485 }
486 else
487 {
488 assert(SVFUtil::isa<IndirectSVFGEdge>(preEdge) && "can only remove indirect SVFG edge");
490 }
491 }
492 }
493
494 return hasSelfCycle;
495}
const GEdgeSetTy & getInEdges() const
void removeSVFGEdge(SVFGEdge *edge)
Remove a SVFG edge.
Definition SVFG.h:238
VFGEdgeSetTy SVFGEdgeSetTy
Definition VFGEdge.h:118

◆ connectAInAndFIn()

void SVF::SVFGOPT::connectAInAndFIn ( const ActualINSVFGNode actualIn,
const FormalINSVFGNode formalIn,
CallSiteID  csId,
SVFGEdgeSetTy edges 
)
inlineoverrideprotectedvirtual

Connect actual-in and formal-in.

Reimplemented from SVF::SVFG.

Definition at line 129 of file SVFGOPT.h.

130 {
131 NodeBS intersection = actualIn->getPointsTo();
132 intersection &= formalIn->getPointsTo();
133 if (intersection.empty() == false)
134 {
137 if (edge != nullptr)
138 edges.insert(edge);
139 }
140 }
NodeID getActualINDef(NodeID ai) const
Get def-site of actual-in/formal-out.
Definition SVFGOPT.h:158
u32_t NodeID
Definition GeneralType.h:56
VFGEdge SVFGEdge
Definition SVFG.h:42
SparseBitVector NodeBS
Definition GeneralType.h:62

◆ connectAParamAndFParam()

void SVF::SVFGOPT::connectAParamAndFParam ( const PAGNode cs_arg,
const PAGNode fun_arg,
const CallICFGNode ,
CallSiteID  csId,
SVFGEdgeSetTy edges 
)
inlineoverrideprotectedvirtual

Connect SVFG nodes between caller and callee for indirect call sites.

Reimplemented from SVF::VFG.

Definition at line 98 of file SVFGOPT.h.

99 {
102 if (edge != nullptr)
103 {
104 PHISVFGNode* phi = SVFUtil::cast<PHISVFGNode>(getSVFGNode(phiId));
106 edges.insert(edge);
107 }
108 }
void addInterPHIOperands(PHISVFGNode *phi, const PAGNode *operand)
Definition SVFGOPT.h:247
SVFGNode * getSVFGNode(NodeID id) const
Get a SVFG node.
Definition SVFG.h:150
NodeID getDef(const PAGNode *pagNode) const
Definition SVFG.h:356
VFGEdge * addCallEdge(NodeID srcId, NodeID dstId, CallSiteID csId)
Definition VFG.cpp:685
PHIVFGNode PHISVFGNode
Definition SVFG.h:56

◆ connectFOutAndAOut()

void SVF::SVFGOPT::connectFOutAndAOut ( const FormalOUTSVFGNode formalOut,
const ActualOUTSVFGNode actualOut,
CallSiteID  csId,
SVFGEdgeSetTy edges 
)
inlineoverrideprotectedvirtual

Connect formal-out and actual-out.

Reimplemented from SVF::SVFG.

Definition at line 142 of file SVFGOPT.h.

143 {
144 NodeBS intersection = formalOut->getPointsTo();
145 intersection &= actualOut->getPointsTo();
146 if (intersection.empty() == false)
147 {
150 if (edge != nullptr)
151 edges.insert(edge);
152 }
153 }
NodeID getFormalOUTDef(NodeID fo) const
Definition SVFGOPT.h:164

◆ connectFRetAndARet()

void SVF::SVFGOPT::connectFRetAndARet ( const PAGNode fun_ret,
const PAGNode cs_ret,
CallSiteID  csId,
SVFGEdgeSetTy edges 
)
inlineoverrideprotectedvirtual

Connect formal-ret and actual ret.

If a function does not have any return instruction. The def of a FormalRetVFGNode is itself (see VFG.h: addFormalRetVFGNode). Therefore, we do not connect return edge from a function without any return instruction (i.e., pag->isPhiNode(fun_ret)==false) because unique fun_ret PAGNode was not collected as a PhiNode in SVFIRBuilder::visitReturnInst

Reimplemented from SVF::VFG.

Definition at line 110 of file SVFGOPT.h.

111 {
117 if (pag->isPhiNode(fun_ret)==false)
118 return;
119
121 if (edge != nullptr)
122 {
123 PHISVFGNode* phi = SVFUtil::cast<PHISVFGNode>(getSVFGNode(phiId));
125 edges.insert(edge);
126 }
127 }
bool isPhiNode(const SVFVar *node) const
Whether this SVFVar is a result operand a of phi node.
Definition SVFIR.h:287
VFGEdge * addRetEdge(NodeID srcId, NodeID dstId, CallSiteID csId)
Definition VFG.cpp:705

◆ formalInOfAddressTakenFunc()

bool SVF::SVFGOPT::formalInOfAddressTakenFunc ( const FormalINSVFGNode fi) const
inlineprivate

Check if formal-in/formal-out reside in address-taken function.

Definition at line 314 of file SVFGOPT.h.

315 {
316 return (fi->getFun()->hasAddressTaken());
317 }

◆ formalOutOfAddressTakenFunc()

bool SVF::SVFGOPT::formalOutOfAddressTakenFunc ( const FormalOUTSVFGNode fo) const
inlineprivate

Definition at line 318 of file SVFGOPT.h.

319 {
320 return (fo->getFun()->hasAddressTaken());
321 }

◆ getActualINDef()

NodeID SVF::SVFGOPT::getActualINDef ( NodeID  ai) const
inlineprotected

Get def-site of actual-in/formal-out.

Definition at line 158 of file SVFGOPT.h.

159 {
160 NodeIDToNodeIDMap::const_iterator it = actualInToDefMap.find(ai);
161 assert(it != actualInToDefMap.end() && "can not find actual-in's def");
162 return it->second;
163 }
NodeIDToNodeIDMap actualInToDefMap
map actual-in to its def-site node
Definition SVFGOPT.h:359

◆ getFormalOUTDef()

NodeID SVF::SVFGOPT::getFormalOUTDef ( NodeID  fo) const
inlineprotected

Definition at line 164 of file SVFGOPT.h.

165 {
166 NodeIDToNodeIDMap::const_iterator it = formalOutToDefMap.find(fo);
167 assert(it != formalOutToDefMap.end() && "can not find formal-out's def");
168 return it->second;
169 }
NodeIDToNodeIDMap formalOutToDefMap
map formal-out to its def-site node
Definition SVFGOPT.h:360

◆ handleInterValueFlow()

void SVFGOPT::handleInterValueFlow ( )
private
  1. Convert FormalParmSVFGNode into PHISVFGNode and add all ActualParmSVFGNoe which may propagate pts to it as phi's operands.
  2. Do the same thing for ActualRetSVFGNode and FormalRetSVFGNode.
  3. Record def site of ActualINSVFGNode. Remove all its edges and connect its predecessors and successors.
  4. Do the same thing for FormalOUTSVFGNode as 3.
  5. Remove ActualINSVFGNode/FormalINSVFGNode/ActualOUTSVFGNode/FormalOUTSVFGNode if they will not be used when updating call graph.

reset def of address-taken variable

Definition at line 110 of file SVFGOPT.cpp.

111{
112 SVFGNodeSet candidates;
113 for (SVFGNodeIDToNodeMapTy::iterator it = SVFG::begin(), eit = SVFG::end();
114 it!=eit; ++it)
115 {
116 SVFGNode* node = it->second;
120 candidates.insert(node);
121 }
122
124 for (SVFGNodeSet::const_iterator it = candidates.begin(), eit = candidates.end();
125 it!=eit; ++it)
126 {
127 SVFGNode* node = *it;
128 if (FormalParmSVFGNode* fp = SVFUtil::dyn_cast<FormalParmSVFGNode>(node))
129 {
131 nodesToBeDeleted.insert(fp);
132 }
133 else if (ActualRetSVFGNode* ar = SVFUtil::dyn_cast<ActualRetSVFGNode>(node))
134 {
136 nodesToBeDeleted.insert(ar);
137 }
138 else if (SVFUtil::isa<ActualParmSVFGNode, FormalRetSVFGNode>(node))
139 {
140 nodesToBeDeleted.insert(node);
141 }
142 else if (SVFUtil::isa<ActualINSVFGNode, FormalOUTSVFGNode>(node))
143 {
145 nodesToBeDeleted.insert(node);
146 }
147 else if (SVFUtil::isa<ActualOUTSVFGNode, FormalINSVFGNode>(node))
148 {
149 if(keepActualOutFormalIn == false)
150 nodesToBeDeleted.insert(node);
151 }
152 }
153
154 for (SVFGNodeSet::iterator it = nodesToBeDeleted.begin(), eit = nodesToBeDeleted.end(); it != eit; ++it)
155 {
156 SVFGNode* node = *it;
157 if (canBeRemoved(node))
158 {
159 if (SVFUtil::isa<ActualOUTSVFGNode, FormalINSVFGNode>(node))
161
162 removeAllEdges(node);
163 removeSVFGNode(node);
164 }
165 }
166}
iterator begin()
Iterators.
Set< SVFGNode * > SVFGNodeSet
Definition SVFGOPT.h:58
void replaceFParamARetWithPHI(PHISVFGNode *phi, SVFGNode *svfgNode)
Replace FormalParam/ActualRet node with PHI node.
Definition SVFGOPT.cpp:171
void retargetEdgesOfAOutFIn(SVFGNode *node)
Connect actual-out/formal-in's predecessors to their successors directly.
Definition SVFGOPT.cpp:270
InterPHISVFGNode * addInterPHIForAR(const ActualRetSVFGNode *ar)
Add inter PHI SVFG node for actual return.
Definition SVFGOPT.h:261
InterPHISVFGNode * addInterPHIForFP(const FormalParmSVFGNode *fp)
Add inter PHI SVFG node for formal parameter.
Definition SVFGOPT.h:253
bool canBeRemoved(const SVFGNode *node)
Definition SVFGOPT.cpp:354
void retargetEdgesOfAInFOut(SVFGNode *node)
Retarget edges related to actual-in/-out and formal-in/-out.
Definition SVFGOPT.cpp:224
void removeSVFGNode(SVFGNode *node)
Remove a SVFGNode.
Definition SVFG.h:243

◆ handleIntraValueFlow()

void SVFGOPT::handleIntraValueFlow ( )
private

Remove MSSAPHI SVFG nodes.

Remove MSSAPHI SVFG nodes.

Skip nodes which have self cycle

remove node's edges if it only has incoming or outgoing edges.

remove all the incoming edges;

remove all the outgoing edges;

remove this node if it has no edges

Definition at line 411 of file SVFGOPT.cpp.

412{
414
416
417 while (!worklist.empty())
418 {
419 const MSSAPHISVFGNode* node = worklist.pop();
420
422 if (checkSelfCycleEdges(node))
423 continue;
424
425 if (node->hasOutgoingEdge() && node->hasIncomingEdge())
426 bypassMSSAPHINode(node);
427
429 if (node->hasIncomingEdge() && node->hasOutgoingEdge() == false)
430 {
434 for (; edgeIt != edgeEit; ++edgeIt)
435 addIntoWorklist((*edgeIt)->getSrcNode());
436
437 removeInEdges(node);
438 }
439 else if (node->hasOutgoingEdge() && node->hasIncomingEdge() == false)
440 {
444 for (; edgeIt != edgeEit; ++edgeIt)
445 addIntoWorklist((*edgeIt)->getDstNode());
446
447 removeOutEdges(node);
448 }
449
451 if (node->hasIncomingEdge() == false && node->hasOutgoingEdge() == false)
452 removeSVFGNode(const_cast<MSSAPHISVFGNode*>(node));
453 }
454}
bool empty() const
Definition WorkList.h:146
bool hasIncomingEdge() const
Has incoming/outgoing edge set.
bool hasOutgoingEdge() const
void bypassMSSAPHINode(const MSSAPHISVFGNode *node)
Remove MSSAPHI node if possible.
Definition SVFGOPT.cpp:500
void removeInEdges(const SVFGNode *node)
Definition SVFGOPT.h:345
void parseSelfCycleHandleOption()
Definition SVFGOPT.cpp:392
void initialWorkList()
Initial work list with MSSAPHI nodes which may be removed.
Definition SVFGOPT.h:211
void removeOutEdges(const SVFGNode *node)
Definition SVFGOPT.h:351
bool checkSelfCycleEdges(const MSSAPHISVFGNode *node)
Remove self cycle edges if needed. Return TRUE if some self cycle edges remained.
Definition SVFGOPT.cpp:462

◆ initialWorkList()

void SVF::SVFGOPT::initialWorkList ( )
inlineprivate

Initial work list with MSSAPHI nodes which may be removed.

Definition at line 211 of file SVFGOPT.h.

212 {
213 for (SVFG::const_iterator it = begin(), eit = end(); it != eit; ++it)
214 addIntoWorklist(it->second);
215 }
IDToNodeMapTy::const_iterator const_iterator

◆ isConnectingTwoCallSites()

bool SVFGOPT::isConnectingTwoCallSites ( const SVFGNode node) const
private

Return TRUE if this node has both incoming call/ret and outgoing call/ret edges.

Definition at line 312 of file SVFGOPT.cpp.

313{
314 bool hasInCallRet = false;
315 bool hasOutCallRet = false;
316
319 for (; edgeIt != edgeEit; ++edgeIt)
320 {
321 if (SVFUtil::isa<CallIndSVFGEdge, RetIndSVFGEdge>(*edgeIt))
322 {
323 hasInCallRet = true;
324 break;
325 }
326 }
327
328 edgeIt = node->OutEdgeBegin();
329 edgeEit = node->OutEdgeEnd();
330 for (; edgeIt != edgeEit; ++edgeIt)
331 {
332 if (SVFUtil::isa<CallIndSVFGEdge, RetIndSVFGEdge>(*edgeIt))
333 {
334 hasOutCallRet = true;
335 break;
336 }
337 }
338
340 return true;
341 else
342 return false;
343}

◆ isDefOfAInFOut()

bool SVF::SVFGOPT::isDefOfAInFOut ( const SVFGNode node)
inlineprivate

Definition at line 295 of file SVFGOPT.h.

296 {
297 return defNodes.test(node->getId());
298 }
NodeBS defNodes
preserved def nodes of formal-in/actual-out
Definition SVFGOPT.h:361
bool test(unsigned Idx) const

◆ optimiseSVFG()

void SVFGOPT::optimiseSVFG ( )
protected

Separate optimisation function to avoid duplicate code.

Separate function to optimise the SVFG to avoid duplicate code.

Definition at line 68 of file SVFGOPT.cpp.

69{
71 dump("SVFG_before_opt");
72
73 DBOUT(DGENERAL, outs() << SVFUtil::pasMsg("\tSVFG Optimisation\n"));
74
76
79
82
83}
#define DBOUT(TYPE, X)
LLVM debug macros, define type of your DBUG model of each pass.
Definition SVFType.h:498
#define DGENERAL
Definition SVFType.h:504
static const Option< bool > KeepAOFI
Definition Options.h:108
static const Option< bool > DumpVFG
Definition Options.h:112
void handleIntraValueFlow()
Remove MSSAPHI SVFG nodes.
Definition SVFGOPT.cpp:411
void handleInterValueFlow()
Definition SVFGOPT.cpp:110
void sfvgOptEnd()
Definition SVFGStat.h:154
void sfvgOptStart()
Definition SVFGStat.h:149
void dump(const std::string &file, bool simple=false)
Dump graph into dot file.
Definition SVFG.cpp:576
SVFGStat * stat
Definition SVFG.h:105
std::string pasMsg(const std::string &msg)
Print each pass/phase message by converting a string into blue string output.
Definition SVFUtil.cpp:101
std::ostream & outs()
Overwrite llvm::outs()
Definition SVFUtil.h:52

◆ parseSelfCycleHandleOption()

void SVFGOPT::parseSelfCycleHandleOption ( )
private

Definition at line 392 of file SVFGOPT.cpp.

393{
394 std::string choice = (Options::SelfCycle().empty()) ? "" : Options::SelfCycle();
395 if (choice.empty() || choice == KeepAllSelfCycle)
396 keepAllSelfCycle = true;
397 else if (choice == KeepContextSelfCycle)
399 else if (choice == KeepNoneSelfCycle)
401 else
402 {
403 SVFUtil::writeWrnMsg("Unrecognised option. All self cycle edges will be kept.");
404 keepAllSelfCycle = true;
405 }
406}
static std::string KeepNoneSelfCycle
Definition SVFGOPT.cpp:44
static std::string KeepContextSelfCycle
Definition SVFGOPT.cpp:43
static std::string KeepAllSelfCycle
Definition SVFGOPT.cpp:42
Carries around command line options.
Definition Options.h:21
static const Option< std::string > SelfCycle
Definition Options.h:109
void writeWrnMsg(const std::string &msg)
Writes a message run through wrnMsg.
Definition SVFUtil.cpp:68

◆ readAndOptSVFG()

void SVFGOPT::readAndOptSVFG ( const std::string &  filename)

Optimised SVFG's aren't written in their optimised form; read full SVFG and optimise it.

Optimised SVFGs aren't written to file; reads the full SVFG and optimises it.

Definition at line 47 of file SVFGOPT.cpp.

48{
51}
virtual void readFile(const std::string &filename)

◆ removeAllEdges()

void SVF::SVFGOPT::removeAllEdges ( const SVFGNode node)
inlineprivate

Remove edges of a SVFG node.

Definition at line 340 of file SVFGOPT.h.

341 {
342 removeInEdges(node);
343 removeOutEdges(node);
344 }

◆ removeInEdges()

void SVF::SVFGOPT::removeInEdges ( const SVFGNode node)
inlineprivate

remove incoming edges

Definition at line 345 of file SVFGOPT.h.

346 {
348 while (node->hasIncomingEdge())
349 removeSVFGEdge(*(node->InEdgeBegin()));
350 }

◆ removeOutEdges()

void SVF::SVFGOPT::removeOutEdges ( const SVFGNode node)
inlineprivate

Definition at line 351 of file SVFGOPT.h.

352 {
353 while (node->hasOutgoingEdge())
354 removeSVFGEdge(*(node->OutEdgeBegin()));
355 }

◆ replaceFParamARetWithPHI()

void SVFGOPT::replaceFParamARetWithPHI ( PHISVFGNode phi,
SVFGNode svfgNode 
)
private

Replace FormalParam/ActualRet node with PHI node.

create a new PHISVFGNode.

migrate formal-param's edges to phi node.

add actual-param/formal-ret into phi's operand list

Definition at line 171 of file SVFGOPT.cpp.

172{
173 assert((SVFUtil::isa<FormalParmSVFGNode, ActualRetSVFGNode>(svfgNode))
174 && "expecting a formal param or actual ret svfg node");
175
177 NodeID phiId = phi->getId();
179 for (SVFGNode::const_iterator it = svfgNode->OutEdgeBegin(), eit = svfgNode->OutEdgeEnd();
180 it != eit; ++it)
181 {
182 const SVFGEdge* outEdge = *it;
183 SVFGNode* dstNode = outEdge->getDstNode();
185 if (const CallDirSVFGEdge* callEdge = SVFUtil::dyn_cast<CallDirSVFGEdge>(outEdge))
186 addCallEdge(phiId, dstId, callEdge->getCallSiteId());
187 else if (const RetDirSVFGEdge* retEdge = SVFUtil::dyn_cast<RetDirSVFGEdge>(outEdge))
188 addRetEdge(phiId, dstId, retEdge->getCallSiteId());
189 else
191 }
192
194 if (FormalParmSVFGNode* fp = SVFUtil::dyn_cast<FormalParmSVFGNode>(svfgNode))
195 {
196 for (SVFGNode::iterator it = svfgNode->InEdgeBegin(), eit = svfgNode->InEdgeEnd();
197 it != eit; ++it)
198 {
199 ActualParmSVFGNode* ap = SVFUtil::cast<ActualParmSVFGNode>((*it)->getSrcNode());
201 // connect actual param's def node to phi node
203 }
204 }
205 else if (ActualRetSVFGNode* ar = SVFUtil::dyn_cast<ActualRetSVFGNode>(svfgNode))
206 {
207 for (SVFGNode::iterator it = svfgNode->InEdgeBegin(), eit = svfgNode->InEdgeEnd();
208 it != eit; ++it)
209 {
210 FormalRetSVFGNode* fr = SVFUtil::cast<FormalRetSVFGNode>((*it)->getSrcNode());
211 addInterPHIOperands(phi, fr->getRet());
212 // connect formal return's def node to phi node
213 addRetEdge(getDef(fr->getRet()), phiId, getCallSiteID(ar->getCallSite(), fr->getFun()));
214 }
215 }
216
218}
const PAGNode * getParam() const
Return parameter.
Definition VFGNode.h:909
const CallICFGNode * getCallSite() const
Return callsite.
Definition VFGNode.h:903
virtual const FunObjVar * getFun() const
Return the function of this ICFGNode.
Definition ICFGNode.h:76
NodeID getId() const
Get ID.
Definition SVFValue.h:158
VFGEdge::VFGEdgeSetTy::iterator iterator
Definition VFGNode.h:54
CallSiteID getCallSiteID(const CallICFGNode *cs, const FunObjVar *func) const
Get callsite given a callsiteID.
Definition VFG.h:178
VFGEdge * addIntraDirectVFEdge(NodeID srcId, NodeID dstId)
Definition VFG.cpp:659

◆ resetDef()

void SVF::SVFGOPT::resetDef ( const PAGNode pagNode,
const SVFGNode node 
)
inlineprivate

Definition at line 270 of file SVFGOPT.h.

271 {
272 PAGNodeToDefMapTy::iterator it = PAGNodeToDefMap.find(pagNode);
273 assert(it != PAGNodeToDefMap.end() && "a SVFIR node doesn't have definition before");
274 it->second = node->getId();
275 }
PAGNodeToDefMapTy PAGNodeToDefMap
map a pag node to its definition SVG node
Definition VFG.h:89

◆ retargetEdgesOfAInFOut()

void SVFGOPT::retargetEdgesOfAInFOut ( SVFGNode node)
private

Retarget edges related to actual-in/-out and formal-in/-out.

Record def sites of actual-in/formal-out and connect from those def-sites to formal-in/actual-out directly if they exist.

Definition at line 224 of file SVFGOPT.cpp.

225{
226 assert(node->getInEdges().size() == 1 && "actual-in/formal-out can only have one incoming edge as its def size");
227
228 SVFGNode* def = nullptr;
230
233 for (; it != eit; ++it)
234 {
235 const IndirectSVFGEdge* inEdge = SVFUtil::cast<IndirectSVFGEdge>(*it);
236 inPointsTo = inEdge->getPointsTo();
237
238 def = inEdge->getSrcNode();
239 if (SVFUtil::isa<ActualINSVFGNode>(node))
240 setActualINDef(node->getId(), def->getId());
241 else if (SVFUtil::isa<FormalOUTSVFGNode>(node))
242 setFormalOUTDef(node->getId(), def->getId());
243 }
244
245 it = node->OutEdgeBegin(), eit = node->OutEdgeEnd();
246 for (; it != eit; ++it)
247 {
248 const IndirectSVFGEdge* outEdge = SVFUtil::cast<IndirectSVFGEdge>(*it);
250 intersection &= outEdge->getPointsTo();
251
252 if (intersection.empty())
253 continue;
254
255 SVFGNode* dstNode = outEdge->getDstNode();
256 if (const CallIndSVFGEdge* callEdge = SVFUtil::dyn_cast<CallIndSVFGEdge>(outEdge))
257 addCallIndirectSVFGEdge(def->getId(), dstNode->getId(), callEdge->getCallSiteId(), intersection);
258 else if (const RetIndSVFGEdge* retEdge = SVFUtil::dyn_cast<RetIndSVFGEdge>(outEdge))
259 addRetIndirectSVFGEdge(def->getId(), dstNode->getId(), retEdge->getCallSiteId(), intersection);
260 else
261 assert(false && "expecting an inter-procedural SVFG edge");
262 }
263
264 removeAllEdges(node);
265}
void setFormalOUTDef(NodeID fo, NodeID def)
Definition SVFGOPT.h:286
void setActualINDef(NodeID ai, NodeID def)
Definition SVFGOPT.h:279

◆ retargetEdgesOfAOutFIn()

void SVFGOPT::retargetEdgesOfAOutFIn ( SVFGNode node)
private

Connect actual-out/formal-in's predecessors to their successors directly.

Definition at line 270 of file SVFGOPT.cpp.

271{
274 for (; inIt != inEit; ++inIt)
275 {
276 const IndirectSVFGEdge* inEdge = SVFUtil::cast<IndirectSVFGEdge>(*inIt);
277 NodeID srcId = inEdge->getSrcID();
278
281 for (; outIt != outEit; ++outIt)
282 {
283 const IndirectSVFGEdge* outEdge = SVFUtil::cast<IndirectSVFGEdge>(*outIt);
284
285 NodeBS intersection = inEdge->getPointsTo();
286 intersection &= outEdge->getPointsTo();
287 if (intersection.empty())
288 continue;
289
290 NodeID dstId = outEdge->getDstID();
291 if (const RetIndSVFGEdge* retEdge = SVFUtil::dyn_cast<RetIndSVFGEdge>(inEdge))
292 {
294 }
295 else if (const CallIndSVFGEdge* callEdge = SVFUtil::dyn_cast<CallIndSVFGEdge>(inEdge))
296 {
298 }
299 else
300 {
302 }
303 }
304 }
305
306 removeAllEdges(node);
307}

◆ setActualINDef()

void SVF::SVFGOPT::setActualINDef ( NodeID  ai,
NodeID  def 
)
inlineprivate

Set def-site of actual-in/formal-out.

Definition at line 279 of file SVFGOPT.h.

280 {
281 bool inserted = actualInToDefMap.emplace(ai, def).second;
282 (void)inserted; // Suppress warning of unused variable under release build
283 assert(inserted && "can not set actual-in's def twice");
284 defNodes.set(def);
285 }
void set(unsigned Idx)

◆ setFormalOUTDef()

void SVF::SVFGOPT::setFormalOUTDef ( NodeID  fo,
NodeID  def 
)
inlineprivate

Definition at line 286 of file SVFGOPT.h.

287 {
288 bool inserted = formalOutToDefMap.emplace(fo, def).second;
289 (void) inserted;
290 assert(inserted && "can not set formal-out's def twice");
291 defNodes.set(def);
292 }

◆ setTokeepActualOutFormalIn()

void SVF::SVFGOPT::setTokeepActualOutFormalIn ( )
inline

Definition at line 71 of file SVFGOPT.h.

72 {
74 }

◆ setTokeepAllSelfCycle()

void SVF::SVFGOPT::setTokeepAllSelfCycle ( )
inline

Definition at line 75 of file SVFGOPT.h.

76 {
77 keepAllSelfCycle = true;
78 }

◆ setTokeepContextSelfCycle()

void SVF::SVFGOPT::setTokeepContextSelfCycle ( )
inline

Definition at line 79 of file SVFGOPT.h.

80 {
82 }

Member Data Documentation

◆ actualInToDefMap

NodeIDToNodeIDMap SVF::SVFGOPT::actualInToDefMap
private

map actual-in to its def-site node

Definition at line 359 of file SVFGOPT.h.

◆ defNodes

NodeBS SVF::SVFGOPT::defNodes
private

preserved def nodes of formal-in/actual-out

Definition at line 361 of file SVFGOPT.h.

◆ formalOutToDefMap

NodeIDToNodeIDMap SVF::SVFGOPT::formalOutToDefMap
private

map formal-out to its def-site node

Definition at line 360 of file SVFGOPT.h.

◆ keepActualOutFormalIn

bool SVF::SVFGOPT::keepActualOutFormalIn
private

Definition at line 365 of file SVFGOPT.h.

◆ keepAllSelfCycle

bool SVF::SVFGOPT::keepAllSelfCycle
private

Definition at line 366 of file SVFGOPT.h.

◆ keepContextSelfCycle

bool SVF::SVFGOPT::keepContextSelfCycle
private

Definition at line 367 of file SVFGOPT.h.

◆ worklist

WorkList SVF::SVFGOPT::worklist
private

storing MSSAPHI nodes which may be removed.

Definition at line 363 of file SVFGOPT.h.


The documentation for this class was generated from the following files: