233 bool inter1 = SVFUtil::isa<CallIndSVFGEdge, RetIndSVFGEdge>(
edge1);
234 bool inter2 = SVFUtil::isa<CallIndSVFGEdge, RetIndSVFGEdge>(
edge2);
256 ar->getCallSite()->getRetICFGNode()));
307 return (
fi->getFun()->hasAddressTaken());
311 return (
fo->getFun()->hasAddressTaken());
bool push(const Data &data)
iterator begin()
Iterators.
IDToNodeMapTy::const_iterator const_iterator
bool hasIncomingEdge() const
Has incoming/outgoing edge set.
bool hasOutgoingEdge() const
iterator OutEdgeBegin()
iterators
FunEntryICFGNode * getFunEntryICFGNode(const SVFFunction *fun)
Add a function entry node.
NodeID getId() const
Get ID.
Set< SVFGNode * > SVFGNodeSet
bool isDefOfAInFOut(const SVFGNode *node)
SVFGEdge * addCallIndirectSVFGEdge(NodeID srcId, NodeID dstId, CallSiteID csid, const NodeBS &cpts)
Add inter-procedural value flow edge.
void replaceFParamARetWithPHI(PHISVFGNode *phi, SVFGNode *svfgNode)
Replace FormalParam/ActualRet node with PHI node.
void handleIntraValueFlow()
Remove MSSAPHI SVFG nodes.
void retargetEdgesOfAOutFIn(SVFGNode *node)
Connect actual-out/formal-in's predecessors to their successors directly.
void addInterPHIOperands(PHISVFGNode *phi, const PAGNode *operand)
void setFormalOUTDef(NodeID fo, NodeID def)
FIFOWorkList< const MSSAPHISVFGNode * > WorkList
void setActualINDef(NodeID ai, NodeID def)
void handleInterValueFlow()
void bypassMSSAPHINode(const MSSAPHISVFGNode *node)
Remove MSSAPHI node if possible.
NodeID getActualINDef(NodeID ai) const
Get def-site of actual-in/formal-out.
Map< NodeID, NodeID > NodeIDToNodeIDMap
void removeInEdges(const SVFGNode *node)
void connectAInAndFIn(const ActualINSVFGNode *actualIn, const FormalINSVFGNode *formalIn, CallSiteID csId, SVFGEdgeSetTy &edges) override
Connect actual-in and formal-in.
SVFGOPT(std::unique_ptr< MemSSA > mssa, VFGK kind)
Constructor.
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.
bool formalInOfAddressTakenFunc(const FormalINSVFGNode *fi) const
Check if formal-in/formal-out reside in address-taken function.
bool addIntoWorklist(const SVFGNode *node)
void buildSVFG() override
Start building SVFG.
bool actualOutOfIndCS(const ActualOUTSVFGNode *ao) const
bool keepActualOutFormalIn
InterPHISVFGNode * addInterPHIForAR(const ActualRetSVFGNode *ar)
Add inter PHI SVFG node for actual return.
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.
bool formalOutOfAddressTakenFunc(const FormalOUTSVFGNode *fo) const
NodeID getFormalOUTDef(NodeID fo) const
WorkList worklist
storing MSSAPHI nodes which may be removed.
NodeIDToNodeIDMap actualInToDefMap
map actual-in to its def-site node
void setTokeepAllSelfCycle()
InterPHISVFGNode * addInterPHIForFP(const FormalParmSVFGNode *fp)
Add inter PHI SVFG node for formal parameter.
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)
NodeIDToNodeIDMap formalOutToDefMap
map formal-out to its def-site node
NodeBS defNodes
preserved def nodes of formal-in/actual-out
void setTokeepContextSelfCycle()
void retargetEdgesOfAInFOut(SVFGNode *node)
Retarget edges related to actual-in/-out and formal-in/-out.
void removeAllEdges(const SVFGNode *node)
Remove edges of a SVFG node.
void parseSelfCycleHandleOption()
bool keepContextSelfCycle
~SVFGOPT() override=default
Destructor.
void connectFOutAndAOut(const FormalOUTSVFGNode *formalOut, const ActualOUTSVFGNode *actualOut, CallSiteID csId, SVFGEdgeSetTy &edges) override
Connect formal-out and actual-out.
void connectFRetAndARet(const PAGNode *fun_ret, const PAGNode *cs_ret, CallSiteID csId, SVFGEdgeSetTy &edges) override
Connect formal-ret and actual ret.
void initialWorkList()
Initial work list with MSSAPHI nodes which may be removed.
void removeOutEdges(const SVFGNode *node)
void setTokeepActualOutFormalIn()
void resetDef(const PAGNode *pagNode, const SVFGNode *node)
bool actualInOfIndCS(const ActualINSVFGNode *ai) const
Check if actual-in/actual-out exist at indirect call site.
SVFGEdge * addRetIndirectSVFGEdge(NodeID srcId, NodeID dstId, CallSiteID csid, const NodeBS &cpts)
Add indirect ret edge from src to dst with one call site ID.
bool checkSelfCycleEdges(const MSSAPHISVFGNode *node)
Remove self cycle edges if needed. Return TRUE if some self cycle edges remained.
SVFGNode * getSVFGNode(NodeID id) const
Get a SVFG node.
virtual void addSVFGNode(SVFGNode *node, ICFGNode *icfgNode)
Add SVFG node.
void removeSVFGEdge(SVFGEdge *edge)
Remove a SVFG edge.
std::unique_ptr< MemSSA > mssa
NodeID getDef(const PAGNode *pagNode) const
bool isPhiNode(const SVFVar *node) const
Whether this SVFVar is a result operand a of phi node.
static SVFIR * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
bool test(unsigned Idx) const
VFGEdge * addRetEdge(NodeID srcId, NodeID dstId, CallSiteID csId)
VFGEdge * addCallEdge(NodeID srcId, NodeID dstId, CallSiteID csId)
PAGNodeToDefMapTy PAGNodeToDefMap
map a pag node to its definition SVG node
VFGEdge::SVFGEdgeSetTy SVFGEdgeSetTy
InterPHIVFGNode InterPHISVFGNode
llvm::IRBuilder IRBuilder