49 return preAnalysis->getPointerAnalysis()->isInRecursion(fun);
63 if (!retPE->getLHSVar()->isPointer() &&
64 !retPE->getLHSVar()->isConstDataOrAggDataButNotNullPtr())
77 for (
const ICFGNode* node : bb->getICFGNodeList())
79 for (
const SVFStmt* stmt : node->getSVFStmts())
83 const SVFVar* rhsVar = store->getRHSVar();
90 for (
const auto& addr : addrs.
getAddrs())
108 return preAnalysis->getPointerAnalysis()->inSameCallGraphSCC(caller, callee);
141 assert(
false &&
"TOP mode should not reach narrowing phase for recursive functions");
148 assert(
false &&
"Unknown recursion handling mode");
248 bool increasing =
true;
250 for (
u32_t cur_iter = 0;; cur_iter++)
252 if (cur_iter >= widen_delay)
288 const ICFGNode* node = singleton->getICFGNode();
const FunObjVar * getCallee(const CallICFGNode *callNode)
Get callee function: directly for direct calls, via pointer analysis for indirect calls.
AbstractState & getAbsState(const ICFGNode *node)
virtual bool narrowCycleState(const AbstractState &prev, const AbstractState &cur, const ICFGCycleWTO *cycle)
virtual AbstractState getFullCycleHeadState(const ICFGCycleWTO *cycle)
bool handleICFGNode(const ICFGNode *node)
Handle an ICFG node: execute statements; return true if state changed.
virtual void skipRecursionWithTop(const CallICFGNode *callNode)
virtual bool widenCycleState(const AbstractState &prev, const AbstractState &cur, const ICFGCycleWTO *cycle)
virtual bool mergeStatesFromPredecessors(const ICFGNode *node)
bool skipRecursiveCall(const CallICFGNode *callNode)
Skip recursive callsites (within SCC); entry calls from outside SCC are not skipped.
virtual bool isRecursiveCallSite(const CallICFGNode *callNode, const FunObjVar *)
Check if caller and callee are in the same CallGraph SCC (i.e. a recursive callsite).
virtual void handleLoopOrRecursion(const ICFGCycleWTO *cycle, const CallICFGNode *caller)
Handle a WTO cycle (loop or recursive function) using widening/narrowing iteration.
bool shouldApplyNarrowing(const FunObjVar *fun)
Check if narrowing should be applied: always for regular loops, mode-dependent for recursion.
virtual bool isRecursiveFun(const FunObjVar *fun)
Check if a function is recursive (part of a call graph SCC).
virtual const AbstractValue & getAbsValue(const ValVar *var, const ICFGNode *node)
bool hasAbsState(const ICFGNode *node)
Map< const ICFGNode *, AbstractState > abstractTrace
per-node trace; owned here
virtual void updateAbsValue(const ValVar *var, const AbstractValue &val, const ICFGNode *node)
virtual void updateAbsState(const ICFGNode *node, const AbstractState &state)
void store(u32_t addr, const AbstractValue &val)
AbstractState narrowing(const AbstractState &other)
domain narrow with other, and return the narrowed domain
AbstractState widening(const AbstractState &other)
domain widen with other, and return the widened domain
AddressValue & getAddrs()
const FunObjVar * getCalledFunction() const
const RetICFGNode * getRetICFGNode() const
Return callsite.
const FunObjVar * getCaller() const
Return callsite.
const std::vector< const SVFBasicBlock * > & getReachableBBs() const
const GEdgeSetTy & getOutEdges() const
virtual const FunObjVar * getFun() const
Return the function of this ICFGNode.
const SVFStmtList & getSVFStmts() const
static IntervalValue top()
Create the IntervalValue [-inf, +inf].
static const OptionMap< u32_t > HandleRecur
recursion handling mode, Default: TOP
static const Option< u32_t > WidenDelay
virtual bool isConstDataOrAggDataButNotNullPtr() const
Check if this variable represents constant data/metadata but not null pointer.
virtual bool isPointer() const
Check if this variable represents a pointer.
const WTOComponentRefList & getWTOComponents() const
Get all wto components in WTO cycle.
const WTONode< GraphT > * head() const
Return the head of the cycle.
const NodeT * getICFGNode() const
Return the graph node.
LLVM_NODISCARD std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > dyn_cast(const Y &Val)
WTOCycle< ICFG > ICFGCycleWTO
WTONode< ICFG > ICFGSingletonWTO
WTOComponent< ICFG > ICFGWTOComp