118 DBOUT(
DGENERAL,
outs() <<
"~~~Out of budget query, downgrade to flow sensitive analysis \n");
143 for(; i >= 0 && j>=0; i--, j--)
145 if(cxt1[i] != cxt2[j])
191 if(
getPAG()->isIndirectCallSites(cs))
215 svfg_csId = callEdge->getCallSiteId();
239 svfg_csId = retEdge->getCallSiteId();
269 "=>" <<
getCallGraph()->getCalleeOfCallSite(csId)->getName() <<
"in recursion \n");
297 "=>" <<
getCallGraph()->getCallerOfCallSite(csId)->getName() <<
"in recursion \n");
338 assert(obj &&
"base object is null??");
340 assert(baseVar &&
"base object is null??");
347 if (gepobj !=
nullptr)
350 &&
"empty refVal in a gep object whose base is a non-dummy object");
355 &&
"empty refVal in non-dummy object");
361 const FunObjVar* svfFun = node->getFun();
362 if(
_ander->isInRecursion(svfFun))
366 if(
_pag->getICFG()->isInLoop(node))
#define DBOUT(TYPE, X)
LLVM debug macros, define type of your DBUG model of each pass.
APOffset getConstantStructFldIdx() const
Get methods.
NodeID getId() const
Get the memory object id.
const ICFGNode * getICFGNode() const
Get the ICFGNode related to the creation of this object.
CallSiteID getCallSiteID(const CallICFGNode *cs, const FunObjVar *callee) const
Get CallSiteID.
virtual bool unionPts(CVar id, const CPtSet &target)
CondPTAImpl(SVFIR *pag, PTATY type)
virtual PointsTo getBVPointsTo(const CPtSet &cpts) const
virtual const CPtSet & getPts(CVar id)
std::string toString() const
OrderedSet< CxtVar >::iterator iterator
iterator begin()
Iterators.
void set(const Element &var)
Add the element into set.
const Cond & get_cond() const
u32_t cxtSize() const
Get context size.
bool containCallStr(NodeID cxt) const
Whether contains callstring cxt.
bool isConcreteCxt() const
Whether it is an concrete context.
virtual bool isHeapCondMemObj(const CxtVar &var, const StoreSVFGNode *store) override
void handleOutOfBudgetDpm(const CxtLocDPItem &dpm)
Handle out-of-budget dpm.
virtual void popRecursiveCallSites(CxtLocDPItem &dpm)
Pop recursive callsites.
FlowDDA * flowDDA
downgrade to flowDDA if out-of-budget
CallSiteID getCSIDAtCall(CxtLocDPItem &dpm, const SVFGEdge *edge)
get callsite id from call, return 0 if it is a spurious call edge
virtual void computeDDAPts(NodeID id) override
Compute points-to set for an unconditional pointer.
virtual bool isEdgeInRecursion(CallSiteID csId)
Whether call/return inside recursion.
virtual bool isCondCompatible(const ContextCond &cxt1, const ContextCond &cxt2, bool singleton) const override
virtual ~ContextDDA()
Destructor.
virtual NodeID getPtrNodeID(const CxtVar &var) const override
Override parent method.
CallSiteID getCSIDAtRet(CxtLocDPItem &dpm, const SVFGEdge *edge)
get callsite id from return, return 0 if it is a spurious return edge
bool testIndCallReachability(CxtLocDPItem &dpm, const FunObjVar *callee, const CallICFGNode *cs)
refine indirect call edge
virtual bool handleBKCondition(CxtLocDPItem &dpm, const SVFGEdge *edge) override
Handle condition for context or path analysis (backward analysis).
virtual void dumpContexts(const ContextCond &cxts)
dump context call strings
ContextDDA(SVFIR *_pag, DDAClient *client)
Constructor.
virtual void initialize() override
Initialization of the analysis.
DDAClient * _client
DDA client.
virtual CxtPtSet processGepPts(const GepSVFGNode *gep, const CxtPtSet &srcPts) override
processGep node
bool matchContext(NodeID cxt)
Match context.
bool pushContext(NodeID cxt)
Push context.
CxtVar getCondVar() const
Get context var.
const ContextCond & getCond() const
Get context.
virtual void updateCachedPointsTo(const CxtLocDPItem &dpm, const CxtPtSet &pts)
bool isOutOfBudgetQuery() const
void setCallGraph(CallGraph *cg)
AndersenWaveDiff * _ander
virtual const CxtPtSet & findPT(const CxtLocDPItem &dpm)
void setCallGraphSCC(CallGraphSCC *scc)
const SVFGNode * getDefSVFGNode(const ValVar *valVar) const
virtual CxtLocDPItem getDPIm(const CxtVar &var, const SVFGNode *loc) const
void addOutOfBudgetDpm(const CxtLocDPItem &dpm)
virtual void buildSVFG(SVFIR *pag)
DDAStat * setDDAStat(DDAStat *s)
virtual void resetQuery()
NodeID getCurNodeID() const
static void setMaxBudget(u32_t max)
set max step budge per query
NodeType * getSrcNode() const
NodeType * getDstNode() const
NodeID getSrcID() const
get methods of the components
NodeID getBaseNode(void) const
Return the base object from which this GEP node came from.
bool isVariantFieldGep() const
Gep statement with a variant field index (pointer arithmetic) for struct field access.
const AccessPath & getAccessPath() const
static const Option< u32_t > CxtBudget
virtual void initialize()
Initialization of a pointer analysis, including building symbol table and SVFIR etc.
virtual bool isBlkObjOrConstantObj(NodeID ptd) const
bool printStat()
Whether print statistics.
PTAStat * stat
Statistics.
NodeID getFIObjVar(NodeID id)
CallGraph * getCallGraph() const
Return call graph.
NodeID getGepObjVar(NodeID id, const APOffset &ap)
void setObjFieldInsensitive(NodeID id)
CallGraphSCC * getCallGraphSCC() const
Return call graph SCC.
const_iterator end() const
const_iterator begin() const
bool test(u32_t n) const
Returns true if n is in this set.
NodeID getFunPtr(const CallICFGNode *cs) const
const ValVar * getValVar(NodeID id) const
static double getClk(bool mark=false)
const SVFStmt * getSVFStmt() const
bool isRetVFGEdge() const
bool isCallVFGEdge() const
virtual const FunObjVar * getFun() const
Get the function of this SVFGNode.
const CallICFGNode * getCallSite(CallSiteID id) const
std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > cast(const Y &Val)
LLVM_NODISCARD bool isa(const Y &Val)
void writeWrnMsg(const std::string &msg)
Writes a message run through wrnMsg.
std::ostream & outs()
Overwrite llvm::outs().
LLVM_NODISCARD std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > dyn_cast(const Y &Val)
PTATY
Pointer analysis type list.
@ Cxt_DDA
context sensitive DDA
StoreVFGNode StoreSVFGNode
CxtStmtDPItem< SVFGNode > CxtLocDPItem
CondVar< ContextCond > CxtVar
CondStdSet< CxtVar > CxtPtSet