124 if (intersection.
empty() ==
false)
137 if (intersection.
empty() ==
false)
213 if (
const MSSAPHISVFGNode* phi = SVFUtil::dyn_cast<MSSAPHISVFGNode>(node))
233 bool inter1 = SVFUtil::isa<CallIndSVFGEdge, RetIndSVFGEdge>(edge1);
234 bool inter2 = SVFUtil::isa<CallIndSVFGEdge, RetIndSVFGEdge>(edge2);
235 return (inter1 && inter2);
264 assert(it !=
PAGNodeToDefMap.end() &&
"a SVFIR node doesn't have definition before");
265 it->second = node->
getId();
274 assert(inserted &&
"can not set actual-in's def twice");
281 assert(inserted &&
"can not set formal-out's def twice");
const CallICFGNode * getCallSite() const
Callsite.
const CallICFGNode * getCallSite() const
Callsite.
const CallICFGNode * getCallSite() const
Return callsite.
const PAGNode * getRev() const
Receive parameter at callsite.
const RetICFGNode * getRetICFGNode() const
Return callsite.
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.
const NodeBS & getPointsTo() const
Return points-to of the MR.
void setOpVer(u32_t pos, const PAGNode *node)
u32_t getOpVerNum() const
NodeID getId() const
Get ID.
bool hasAddressTaken() const
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)
InterPHISVFGNode * addInterPHIForFP(const FormalParmSVFGNode *fp)
Add inter PHI SVFG node for formal parameter.
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
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()
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.
InterPHISVFGNode * addInterPHIForAR(const ActualRetSVFGNode *ar)
Add inter PHI SVFG node for actual return.
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
static SVFIR * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
bool isPhiNode(const SVFVar *node) const
Whether this SVFVar is a result operand a of phi node.
bool test(unsigned Idx) const
virtual const SVFFunction * getFun() const
Get the function of this SVFGNode.
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
constexpr std::remove_reference< T >::type && move(T &&t) noexcept
InterPHIVFGNode InterPHISVFGNode
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
std::unordered_set< Key, Hash, KeyEqual, Allocator > Set