37using namespace SVFUtil;
118 DBOUT(
DGENERAL,
outs() <<
"~~~Out of budget query, downgrade to flow sensitive analysis \n");
141 int i =
cxt1.cxtSize() - 1;
142 int j =
cxt2.cxtSize() - 1;
143 for(;
i >= 0 &&
j>=0;
i--,
j--)
166 if (
gepStmt->isVariantFieldGep())
175 gepStmt->getAccessPath().getConstantStructFldIdx()));
191 if(
getPAG()->isIndirectCallSites(cs))
217 svfg_csId = SVFUtil::cast<CallIndSVFGEdge>(
edge)->getCallSiteId();
241 svfg_csId = SVFUtil::cast<RetIndSVFGEdge>(
edge)->getCallSiteId();
260 if (
edge->isCallVFGEdge())
269 "=>" <<
getCallGraph()->getCalleeOfCallSite(csId)->getName() <<
"in recursion \n");
274 if (
dpm.matchContext(csId) ==
false)
277 <<
edge->getDstID() <<
" --| " <<
edge->getSrcID() <<
" \t");
288 else if (
edge->isRetVFGEdge())
297 "=>" <<
getCallGraph()->getCallerOfCallSite(csId)->getName() <<
"in recursion \n");
304 if (
dpm.getCond().containCallStr(csId))
312 assert(
dpm.getCond().containCallStr(csId) ==
false &&
"contain visited call string ??");
313 if(
dpm.pushContext(csId))
338 assert(mem &&
"memory object is null??");
341 if (SVFUtil::isa<HeapObjVar, DummyObjVar>(
baseVar))
350 &&
"empty refVal in a gep object whose base is a non-dummy object");
354 assert((SVFUtil::isa<DummyObjVar, DummyValVar>(
pnode))
355 &&
"empty refVal in non-dummy object");
361 if (
const auto& node =
362 SVFUtil::dyn_cast<ICFGNode>(gNode))
367 if(
var.get_cond().isConcreteCxt() ==
false)
#define DBOUT(TYPE, X)
LLVM debug macros, define type of your DBUG model of each pass.
const PointsTo & getPts(NodeID id) override
virtual bool unionPts(CVar id, const CPtSet &target)
virtual PointsTo getBVPointsTo(const CPtSet &cpts) const
Given a conditional pts return its bit vector points-to.
virtual const CPtSet & getPts(CVar id)
OrderedSet< Element >::iterator iterator
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
virtual void handleStatement(const SVFGNode *, NodeID)
Call back used by DDAVFSolver.
double _TotalTimeOfQueries
virtual void updateCachedPointsTo(const CxtLocDPItem &dpm, const CxtPtSet &pts)
bool isOutOfBudgetQuery() const
AndersenWaveDiff * _ander
Andersen's analysis.
const SVFGNode * getDefSVFGNode(const PAGNode *pagNode) const
GetDefinition SVFG.
virtual const CxtPtSet & findPT(const CxtLocDPItem &dpm)
Compute points-to.
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.
void addOutOfBudgetDpm(const CxtLocDPItem &dpm)
DDAStat * ddaStat
DDA stat.
virtual void buildSVFG(SVFIR *pag)
Build SVFG.
DDAStat * setDDAStat(DDAStat *s)
Set DDAStat.
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.
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 * getGNode(NodeID id) const
Get a node.
bool isInLoop(const ICFGNode *node)
Whether node is in a loop.
const SVFBaseNode * getGNode() const
Get the reference value to this object.
const SVFValue * getValue() const
Get the reference value to this object.
static const Option< u32_t > CxtBudget
CallSiteID getCallSiteID(const CallICFGNode *cs, const SVFFunction *callee) const
Get CallSiteID.
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)
CallGraphSCC * getCallGraphSCC() const
Return call graph SCC.
NodeID getFunPtr(const CallICFGNode *cs) const
const BaseObjVar * getBaseObject(NodeID id) const
const MemObj * getObject(NodeID id) const
virtual void printStatPerQuery(NodeID, const PointsTo &)
virtual void performStatPerQuery(NodeID)
static double getClk(bool mark=false)
const CallICFGNode * getCallSite(CallSiteID id) const
void writeWrnMsg(const std::string &msg)
Writes a message run through wrnMsg.
std::ostream & outs()
Overwrite llvm::outs()
llvm::IRBuilder IRBuilder