37 using namespace SVFUtil;
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))
214 if (
const CallDirSVFGEdge* callEdge = SVFUtil::dyn_cast<CallDirSVFGEdge>(edge))
215 svfg_csId = callEdge->getCallSiteId();
217 svfg_csId = SVFUtil::cast<CallIndSVFGEdge>(edge)->getCallSiteId();
238 if (
const RetDirSVFGEdge* retEdge = SVFUtil::dyn_cast<RetDirSVFGEdge>(edge))
239 svfg_csId = retEdge->getCallSiteId();
241 svfg_csId = SVFUtil::cast<RetIndSVFGEdge>(edge)->getCallSiteId();
269 "=>" <<
getCallGraph()->getCalleeOfCallSite(csId)->getName() <<
"in recursion \n");
297 "=>" <<
getCallGraph()->getCallerOfCallSite(csId)->getName() <<
"in recursion \n");
338 assert(mem &&
"memory object is null??");
344 GepObjVar* gepobj = SVFUtil::dyn_cast<GepObjVar>(pnode);
345 if (gepobj !=
nullptr)
348 &&
"empty refVal in a gep object whose base is a non-dummy object");
352 assert((SVFUtil::isa<DummyObjVar, DummyValVar>(pnode))
353 &&
"empty refVal in non-dummy object");
359 if (
const auto& node =
360 SVFUtil::dyn_cast<ICFGNode>(gNode))
365 if(var.
get_cond().isConcreteCxt() ==
false)
#define DBOUT(TYPE, X)
LLVM debug macros, define type of your DBUG model of each pass.
APOffset getConstantStructFldIdx() const
Get methods.
const PointsTo & getPts(NodeID id) override
virtual bool unionPts(CVar id, const CPtSet &target)
virtual const CPtSet & getPts(CVar id)
virtual PointsTo getBVPointsTo(const CPtSet &cpts) const
Given a conditional pts return its bit vector points-to.
std::string toString() const
OrderedSet< Element >::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.
virtual bool isHeapCondMemObj(const CxtVar &var, const StoreSVFGNode *store) override
bool testIndCallReachability(CxtLocDPItem &dpm, const SVFFunction *callee, const CallICFGNode *cs)
refine indirect call edge
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
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 handleStatement(const SVFGNode *, NodeID)
Call back used by DDAVFSolver.
double _TotalTimeOfQueries
virtual void updateCachedPointsTo(const CxtLocDPItem &dpm, const CxtPtSet &pts)
virtual const CxtPtSet & findPT(const CxtLocDPItem &dpm)
Compute points-to.
const SVFGNode * getDefSVFGNode(const PAGNode *pagNode) const
GetDefinition SVFG.
bool isOutOfBudgetQuery() const
AndersenWaveDiff * _ander
Andersen's analysis.
void setCallGraphSCC(CallGraphSCC *scc)
Set callgraphSCC.
SVFG * getSVFG() const
Return SVFG.
virtual CxtLocDPItem getDPIm(const CxtVar &var, const SVFGNode *loc) const
Given CVar and location (SVFGNode) return a new DPItem.
DDAStat * setDDAStat(DDAStat *s)
Set DDAStat.
void addOutOfBudgetDpm(const CxtLocDPItem &dpm)
DDAStat * ddaStat
DDA stat.
virtual void buildSVFG(SVFIR *pag)
Build SVFG.
void setCallGraph(PTACallGraph *cg)
Set callgraph.
bool outOfBudgetQuery
Whether the current query is out of step limits.
virtual void resetQuery()
Reset visited map for next points-to query.
NodeID getCurNodeID() const
static void setMaxBudget(u32_t max)
set max step budge per query
void computeDDAPts(NodeID id) override
Compute points-to set for all top variable.
virtual void initialize() override
Initialization of the analysis.
NodeType * getSrcNode() const
NodeID getSrcID() const
get methods of the components
NodeType * getDstNode() const
NodeType * getGNode(NodeID id) const
Get a node.
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
bool isInLoop(const ICFGNode *node)
Whether node is in a loop.
const SVFValue * getValue() const
Get the reference value to this object.
const SVFBaseNode * getGNode() const
Get the reference value to this object.
static const Option< u32_t > CxtBudget
CallSiteID getCallSiteID(const CallICFGNode *cs, const SVFFunction *callee) const
CallGraphSCC * getCallGraphSCC() const
Return call graph SCC.
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)
PTACallGraph * getCallGraph() const
Return call graph.
bool isInRecursion(const SVFFunction *fun) const
NodeID getGepObjVar(NodeID id, const APOffset &ap)
void setObjFieldInsensitive(NodeID id)
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 MemObj * getObject(NodeID id) const
virtual void printStatPerQuery(NodeID, const PointsTo &)
virtual void performStatPerQuery(NodeID)
static double getClk(bool mark=false)
const PAGEdge * getPAGEdge() const
bool isRetVFGEdge() const
bool isCallVFGEdge() const
const CallICFGNode * getCallSite(CallSiteID id) const
void writeWrnMsg(const std::string &msg)
Writes a message run through wrnMsg.
std::ostream & outs()
Overwrite llvm::outs()