Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | Static Protected Attributes | Private Member Functions | List of all members
SVF::PointerAnalysis Class Referenceabstract

#include <PointerAnalysis.h>

Inheritance diagram for SVF::PointerAnalysis:
SVF::CondPTAImpl< ContextCond > SVF::BVDataPTAImpl SVF::CondPTAImpl< Cond > SVF::ContextDDA SVF::AndersenBase SVF::CFLBase SVF::FlowDDA SVF::FlowSensitive SVF::Andersen SVF::Steensgaard SVF::TypeAnalysis SVF::CFLAlias SVF::CFLVF SVF::VersionedFlowSensitive SVF::AndersenSCD SVF::AndersenWaveDiff SVF::POCRAlias SVF::POCRHybrid SVF::AndersenSFR

Public Types

typedef Set< const CallICFGNode * > CallSiteSet
 Indirect call edges type, map a callsite to a set of callees.
 
typedef SVFIR::CallSiteToFunPtrMap CallSiteToFunPtrMap
 
typedef Set< const FunObjVar * > FunctionSet
 
typedef OrderedMap< const CallICFGNode *, FunctionSetCallEdgeMap
 
typedef SCCDetection< CallGraph * > CallGraphSCC
 
typedef Set< const GlobalObjVar * > VTableSet
 
typedef Set< const FunObjVar * > VFunSet
 

Public Member Functions

ICFGgetICFG () const
 Get ICFG.
 
u32_t getNumOfResolvedIndCallEdge () const
 Return number of resolved indirect call edges.
 
CallGraphgetCallGraph () const
 Return call graph.
 
CallGraphSCCgetCallGraphSCC () const
 Return call graph SCC.
 
 PointerAnalysis (SVFIR *pag, PTATY ty=PTATY::Default_PTA, bool alias_check=true)
 Constructor.
 
PTATY getAnalysisTy () const
 Type of pointer analysis.
 
PTAImplTy getImplTy () const
 Return implementation type of the pointer analysis.
 
bool printStat ()
 Whether print statistics.
 
void disablePrintStat ()
 Whether print statistics.
 
CallEdgeMapgetIndCallMap ()
 Get callees from an indirect callsite.
 
bool hasIndCSCallees (const CallICFGNode *cs) const
 
const FunctionSetgetIndCSCallees (const CallICFGNode *cs) const
 
virtual void resolveIndCalls (const CallICFGNode *cs, const PointsTo &target, CallEdgeMap &newEdges)
 Resolve indirect call edges.
 
void callGraphSCCDetection ()
 PTACallGraph SCC related methods.
 
NodeID getCallGraphSCCRepNode (NodeID id) const
 Get SCC rep node of a SVFG node.
 
bool inSameCallGraphSCC (const FunObjVar *fun1, const FunObjVar *fun2)
 Return TRUE if this edge is inside a PTACallGraph SCC, i.e., src node and dst node are in the same SCC on the SVFG.
 
bool isInRecursion (const FunObjVar *fun) const
 
bool isLocalVarInRecursiveFun (NodeID id) const
 Whether a local variable is in function recursions.
 
virtual const std::string PTAName () const
 Return PTA name.
 
CommonCHGraphgetCHGraph () const
 get CHGraph
 
void getVFnsFromCHA (const CallICFGNode *cs, VFunSet &vfns)
 
void getVFnsFromPts (const CallICFGNode *cs, const PointsTo &target, VFunSet &vfns)
 
void connectVCallToVFns (const CallICFGNode *cs, const VFunSet &vfns, CallEdgeMap &newEdges)
 
virtual void resolveCPPIndCalls (const CallICFGNode *cs, const PointsTo &target, CallEdgeMap &newEdges)
 Resolve cpp indirect call edges.
 

Static Public Attributes

static const std::string aliasTestMayAlias = "MAYALIAS"
 
static const std::string aliasTestMayAliasMangled = "_Z8MAYALIASPvS_"
 
static const std::string aliasTestNoAlias = "NOALIAS"
 
static const std::string aliasTestNoAliasMangled = "_Z7NOALIASPvS_"
 
static const std::string aliasTestPartialAlias = "PARTIALALIAS"
 
static const std::string aliasTestPartialAliasMangled = "_Z12PARTIALALIASPvS_"
 
static const std::string aliasTestMustAlias = "MUSTALIAS"
 
static const std::string aliasTestMustAliasMangled = "_Z9MUSTALIASPvS_"
 
static const std::string aliasTestFailMayAlias = "EXPECTEDFAIL_MAYALIAS"
 
static const std::string aliasTestFailMayAliasMangled = "_Z21EXPECTEDFAIL_MAYALIASPvS_"
 
static const std::string aliasTestFailNoAlias = "EXPECTEDFAIL_NOALIAS"
 
static const std::string aliasTestFailNoAliasMangled = "_Z20EXPECTEDFAIL_NOALIASPvS_"
 

Protected Attributes

bool print_stat
 User input flags.
 
bool alias_validation
 Flag for validating points-to/alias results.
 
u32_t OnTheFlyIterBudgetForStat
 Flag for iteration budget for on-the-fly statistics.
 
PTATY ptaTy
 Pointer analysis Type.
 
PTAImplTy ptaImplTy
 PTA implementation type.
 
PTAStatstat
 Statistics.
 
CallGraphcallgraph
 Call graph used for pointer analysis.
 
CallGraphSCCcallGraphSCC
 SCC for PTACallGraph.
 
ICFGicfg
 Interprocedural control-flow graph.
 
CommonCHGraphchgraph
 CHGraph.
 

Static Protected Attributes

static SVFIRpag = nullptr
 SVFIR.
 

Private Member Functions

void destroy ()
 Release the memory.
 
SVFIRgetPAG () const
 
PTAStatgetStat () const
 Get PTA stat.
 
OrderedNodeSetgetAllValidPtrs ()
 Get all Valid Pointers for resolution.
 
virtual void initialize ()
 Initialization of a pointer analysis, including building symbol table and SVFIR etc.
 
virtual void finalize ()
 Finalization of a pointer analysis, including checking alias correctness.
 
virtual void analyze ()=0
 Start Analysis here (main part of pointer analysis). It needs to be implemented in child class.
 
virtual void computeDDAPts (NodeID)
 Compute points-to results on-demand, overridden by derived classes.
 
virtual AliasResult alias (const SVFVar *V1, const SVFVar *V2)=0
 Interface exposed to users of our pointer analysis, given Value infos.
 
virtual AliasResult alias (NodeID node1, NodeID node2)=0
 Interface exposed to users of our pointer analysis, given PAGNodeID.
 
virtual const PointsTogetPts (NodeID ptr)=0
 Get points-to targets of a pointer. It needs to be implemented in child class.
 
virtual const NodeSetgetRevPts (NodeID nodeId)=0
 
bool mayAlias (const SVFVar *V1, const SVFVar *V2)
 Convenience bool wrappers: return true if the two operands may/must/partial alias.
 
bool mayAlias (NodeID node1, NodeID node2)
 
void printIndCSTargets (const CallICFGNode *cs, const FunctionSet &targets)
 Print targets of a function pointer.
 
virtual void dumpTopLevelPtsTo ()
 
virtual void dumpAllPts ()
 
virtual void dumpCPts ()
 
virtual void dumpPts (NodeID ptr, const PointsTo &pts)
 
void printIndCSTargets ()
 
void dumpAllTypes ()
 
void dumpStat ()
 Dump the statistics.
 
bool containBlackHoleNode (const PointsTo &pts)
 Determine whether a points-to contains a black hole or constant node.
 
bool containConstantNode (const PointsTo &pts)
 
virtual bool isBlkObjOrConstantObj (NodeID ptd) const
 
bool isHeapMemObj (NodeID id) const
 Whether this object is heap or array.
 
bool isArrayMemObj (NodeID id) const
 
bool isFIObjNode (NodeID id) const
 
NodeID getBaseObjVarID (NodeID id)
 
NodeID getFIObjVar (NodeID id)
 
NodeID getGepObjVar (NodeID id, const APOffset &ap)
 
virtual const NodeBSgetAllFieldsObjVars (NodeID id)
 
void setObjFieldInsensitive (NodeID id)
 
bool isFieldInsensitive (NodeID id) const
 
const CallSiteToFunPtrMapgetIndirectCallsites () const
 Return all indirect callsites.
 
NodeID getFunPtr (const CallICFGNode *cs) const
 Return function pointer PAGNode at a callsite cs.
 
virtual void validateTests ()
 Alias check functions to verify correctness of pointer analysis.
 
virtual void validateSuccessTests (std::string fun)
 
virtual void validateExpectedFailureTests (std::string fun)
 
void resetObjFieldSensitive ()
 Reset all object node as field-sensitive.
 

Detailed Description

Definition at line 57 of file PointerAnalysis.h.

Member Typedef Documentation

◆ CallEdgeMap

Definition at line 66 of file PointerAnalysis.h.

◆ CallGraphSCC

Definition at line 67 of file PointerAnalysis.h.

◆ CallSiteSet

Indirect call edges type, map a callsite to a set of callees.

Definition at line 63 of file PointerAnalysis.h.

◆ CallSiteToFunPtrMap

Definition at line 64 of file PointerAnalysis.h.

◆ FunctionSet

Definition at line 65 of file PointerAnalysis.h.

◆ VFunSet

Definition at line 69 of file PointerAnalysis.h.

◆ VTableSet

Definition at line 68 of file PointerAnalysis.h.

Constructor & Destructor Documentation

◆ PointerAnalysis()

PointerAnalysis::PointerAnalysis ( SVFIR p,
PTATY  ty = PTATY::Default_PTA,
bool  alias_check = true 
)

Constructor.

Constructor

Definition at line 69 of file PointerAnalysis.cpp.

69 : ptaTy(ty), stat(nullptr), callgraph(nullptr),
70 callGraphSCC(nullptr), icfg(nullptr),
71 chgraph(nullptr)
72{
73 pag = p;
78}
cJSON * p
Definition cJSON.cpp:2559
static const Option< bool > EnableAliasCheck
Definition Options.h:127
static const Option< bool > PStat
Definition Options.h:116
static const Option< u32_t > StatBudget
Definition Options.h:117
CommonCHGraph * chgraph
CHGraph.
bool print_stat
User input flags.
PTAImplTy ptaImplTy
PTA implementation type.
PTAStat * stat
Statistics.
ICFG * icfg
Interprocedural control-flow graph.
CallGraph * callgraph
Call graph used for pointer analysis.
bool alias_validation
Flag for validating points-to/alias results.
static SVFIR * pag
SVFIR.
PTATY ptaTy
Pointer analysis Type.
CallGraphSCC * callGraphSCC
SCC for PTACallGraph.
u32_t OnTheFlyIterBudgetForStat
Flag for iteration budget for on-the-fly statistics.
@ BaseImpl
Represents PointerAnalaysis.
Definition PTATY.h:41
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

◆ ~PointerAnalysis()

PointerAnalysis::~PointerAnalysis ( )
virtual

Destructor.

Destructor

Definition at line 83 of file PointerAnalysis.cpp.

84{
85 destroy();
86 // do not delete the SVFIR for now
87 //delete pag;
88}
void destroy()
Release the memory.

Member Function Documentation

◆ alias() [1/2]

virtual AliasResult SVF::PointerAnalysis::alias ( const SVFVar V1,
const SVFVar V2 
)
pure virtual

Interface exposed to users of our pointer analysis, given Value infos.

Implemented in SVF::CondPTAImpl< Cond >, SVF::CondPTAImpl< ContextCond >, and SVF::BVDataPTAImpl.

◆ alias() [2/2]

virtual AliasResult SVF::PointerAnalysis::alias ( NodeID  node1,
NodeID  node2 
)
pure virtual

Interface exposed to users of our pointer analysis, given PAGNodeID.

Implemented in SVF::CFLAlias, SVF::CondPTAImpl< Cond >, SVF::CondPTAImpl< ContextCond >, and SVF::BVDataPTAImpl.

◆ analyze()

virtual void SVF::PointerAnalysis::analyze ( )
pure virtual

Start Analysis here (main part of pointer analysis). It needs to be implemented in child class.

Implemented in SVF::CFLBase, SVF::ContextDDA, SVF::FlowDDA, SVF::AndersenBase, SVF::FlowSensitive, and SVF::TypeAnalysis.

◆ callGraphSCCDetection()

void SVF::PointerAnalysis::callGraphSCCDetection ( )
inline

PTACallGraph SCC related methods.

PTACallGraph SCC detection

Definition at line 351 of file PointerAnalysis.h.

352 {
353 if(callGraphSCC==nullptr)
355
356 callGraphSCC->find();
357 }
SCCDetection< CallGraph * > CallGraphSCC

◆ computeDDAPts()

virtual void SVF::PointerAnalysis::computeDDAPts ( NodeID  )
inlinevirtual

Compute points-to results on-demand, overridden by derived classes.

Reimplemented in SVF::ContextDDA, and SVF::FlowDDA.

Definition at line 188 of file PointerAnalysis.h.

188{}

◆ connectVCallToVFns()

void PointerAnalysis::connectVCallToVFns ( const CallICFGNode cs,
const VFunSet vfns,
CallEdgeMap newEdges 
)

Definition at line 466 of file PointerAnalysis.cpp.

467{
469 for (VFunSet::const_iterator fit = vfns.begin(),
470 feit = vfns.end(); fit != feit; ++fit)
471 {
472 const FunObjVar* callee = *fit;
474 if (getIndCallMap()[cs].count(callee) > 0)
475 continue;
476 if(cs->arg_size() == callee->arg_size() ||
477 (cs->isVarArg() && callee->isVarArg()))
478 {
479 newEdges[cs].insert(callee);
480 getIndCallMap()[cs].insert(callee);
481 const CallICFGNode* callBlockNode = cs;
482 callgraph->addIndirectCallGraphEdge(callBlockNode, cs->getCaller(),callee);
483 }
484 }
485}
void addIndirectCallGraphEdge(const CallICFGNode *cs, const FunObjVar *callerFun, const FunObjVar *calleeFun)
Add indirect call edges.
bool isVarArg() const
Definition ICFGNode.h:505
const FunObjVar * getCaller() const
Return callsite.
Definition ICFGNode.h:452
u32_t arg_size() const
Definition ICFGNode.h:487
const FunObjVar * getDefFunForMultipleModule() const
CallEdgeMap & getIndCallMap()
Get callees from an indirect callsite.

◆ containBlackHoleNode()

bool SVF::PointerAnalysis::containBlackHoleNode ( const PointsTo pts)
inline

Determine whether a points-to contains a black hole or constant node.

Definition at line 254 of file PointerAnalysis.h.

255 {
256 return pts.test(pag->getBlackHoleNode());
257 }
NodeID getBlackHoleNode() const
Definition IRGraph.h:247

◆ containConstantNode()

bool SVF::PointerAnalysis::containConstantNode ( const PointsTo pts)
inline

Definition at line 258 of file PointerAnalysis.h.

259 {
260 return pts.test(pag->getConstantNode());
261 }
NodeID getConstantNode() const
Definition IRGraph.h:251

◆ destroy()

void PointerAnalysis::destroy ( )
private

Release the memory.

Definition at line 91 of file PointerAnalysis.cpp.

92{
93 delete callgraph;
94 callgraph = nullptr;
95
96 delete callGraphSCC;
97 callGraphSCC = nullptr;
98
99 delete stat;
100 stat = nullptr;
101}

◆ disablePrintStat()

void SVF::PointerAnalysis::disablePrintStat ( )
inline

Whether print statistics.

Definition at line 324 of file PointerAnalysis.h.

325 {
326 print_stat = false;
327 }

◆ dumpAllPts()

virtual void SVF::PointerAnalysis::dumpAllPts ( )
inlinevirtual

Reimplemented in SVF::BVDataPTAImpl.

Definition at line 220 of file PointerAnalysis.h.

220{}

◆ dumpAllTypes()

void PointerAnalysis::dumpAllTypes ( )

Definition at line 233 of file PointerAnalysis.cpp.

234{
235 for (OrderedNodeSet::iterator nIter = this->getAllValidPtrs().begin();
236 nIter != this->getAllValidPtrs().end(); ++nIter)
237 {
238 const SVFVar* node = getPAG()->getSVFVar(*nIter);
239 if (SVFUtil::isa<DummyObjVar, DummyValVar>(node))
240 continue;
241
242 outs() << "##<" << node->getName() << "> ";
243 outs() << "Source Loc: " << node->getSourceLoc();
244 outs() << "\nNodeID " << node->getId() << "\n";
245
246 const SVFType* type = node->getType();
248 }
249}
newitem type
Definition cJSON.cpp:2739
void printFlattenFields(const SVFType *type)
Debug method.
Definition IRGraph.cpp:73
SVFIR * getPAG() const
OrderedNodeSet & getAllValidPtrs()
Get all Valid Pointers for resolution.
const SVFVar * getSVFVar(NodeID id) const
ObjVar/GepObjVar/BaseObjVar.
Definition SVFIR.h:133
NodeID getId() const
Get ID.
Definition SVFValue.h:161
virtual const SVFType * getType() const
Definition SVFValue.h:172
virtual const std::string getSourceLoc() const
Definition SVFValue.h:197
virtual const std::string & getName() const
Definition SVFValue.h:187
std::ostream & outs()
Overwrite llvm::outs()
Definition SVFUtil.h:52

◆ dumpCPts()

virtual void SVF::PointerAnalysis::dumpCPts ( )
inlinevirtual

Reimplemented in SVF::CondPTAImpl< Cond >, SVF::CondPTAImpl< ContextCond >, and SVF::BVDataPTAImpl.

Definition at line 221 of file PointerAnalysis.h.

221{}

◆ dumpPts()

void PointerAnalysis::dumpPts ( NodeID  ptr,
const PointsTo pts 
)
virtual

Dump points-to of top-level pointers (ValVar)

print the points-to set of node which has the maximum pts size.

Definition at line 254 of file PointerAnalysis.cpp.

255{
256
257 const SVFVar* node = pag->getSVFVar(ptr);
259 if (SVFUtil::isa<DummyObjVar> (node))
260 {
261 outs() << "##<Dummy Obj > id:" << node->getId();
262 }
263 else if (!SVFUtil::isa<DummyValVar>(node) && !SVFIR::pagReadFromTXT())
264 {
265 outs() << "##<" << node->getName() << "> ";
266 outs() << "Source Loc: " << node->getSourceLoc();
267 }
268 outs() << "\nPtr " << node->getId() << " ";
269
270 if (pts.empty())
271 {
272 outs() << "\t\tPointsTo: {empty}\n\n";
273 }
274 else
275 {
276 outs() << "\t\tPointsTo: { ";
277 for (PointsTo::iterator it = pts.begin(), eit = pts.end(); it != eit;
278 ++it)
279 outs() << *it << " ";
280 outs() << "}\n\n";
281 }
282
283 outs() << "";
284
285 for (PointsTo::iterator it = pts.begin(), eit = pts.end(); it != eit; ++it)
286 {
287 const SVFVar* node = pag->getSVFVar(*it);
288 if(SVFUtil::isa<ObjVar>(node) == false)
289 continue;
290 NodeID ptd = node->getId();
291 outs() << "!!Target NodeID " << ptd << "\t [";
292 const SVFVar* pagNode = pag->getSVFVar(ptd);
293 if (SVFUtil::isa<DummyValVar>(node))
294 outs() << "DummyVal\n";
295 else if (SVFUtil::isa<DummyObjVar>(node))
296 outs() << "Dummy Obj id: " << node->getId() << "]\n";
297 else
298 {
300 {
301 outs() << "<" << pagNode->getName() << "> ";
302 outs() << "Source Loc: "
303 << pagNode->getSourceLoc() << "] \n";
304 }
305 }
306 }
307}
static bool pagReadFromTXT()
Definition SVFIR.h:278
u32_t NodeID
Definition GeneralType.h:56

◆ dumpStat()

void PointerAnalysis::dumpStat ( )

Dump the statistics.

Definition at line 164 of file PointerAnalysis.cpp.

165{
166
167 if(print_stat && stat)
168 {
169 stat->performStat();
170 }
171}
void performStat() override
Definition PTAStat.cpp:53

◆ dumpTopLevelPtsTo()

virtual void SVF::PointerAnalysis::dumpTopLevelPtsTo ( )
inlinevirtual

◆ finalize()

void PointerAnalysis::finalize ( )
virtual

Finalization of a pointer analysis, including checking alias correctness.

Finalize the analysis after solving Given the alias results, verify whether it is correct or not using alias check functions

Print statistics

Dump results

Reimplemented in SVF::CFLAlias, SVF::CFLBase, SVF::CFLVF, SVF::CondPTAImpl< Cond >, SVF::CondPTAImpl< ContextCond >, SVF::Andersen, SVF::ContextDDA, SVF::FlowDDA, SVF::BVDataPTAImpl, SVF::AndersenBase, SVF::FlowSensitive, SVF::TypeAnalysis, and SVF::VersionedFlowSensitive.

Definition at line 177 of file PointerAnalysis.cpp.

178{
179
181 dumpStat();
182
184 if (Options::PTSPrint())
185 {
187 //dumpAllPts();
188 //dumpCPts();
189 }
190
191 if (Options::TypePrint())
192 dumpAllTypes();
193
195 dumpAllPts();
196
199
201
203 getCallGraph()->dump("callgraph_final");
204
207
210}
void dump(const std::string &filename)
Dump the graph.
void verifyCallGraph()
Issue a warning if the function which has indirect call sites can not be reached from program entry.
bool isBuiltFromFile()
Whether this SVFIR built from a txt file.
Definition IRGraph.h:150
static const Option< bool > CallGraphDotGraph
Definition Options.h:123
static const Option< bool > PTSPrint
Definition Options.h:113
static const Option< bool > PTSAllPrint
Definition Options.h:114
static const Option< bool > TypePrint
Definition Options.h:111
static Option< bool > UsePreCompFieldSensitive
Definition Options.h:126
static const Option< bool > FuncPointerPrint
Definition Options.h:112
virtual void validateTests()
Alias check functions to verify correctness of pointer analysis.
virtual void dumpTopLevelPtsTo()
CallGraph * getCallGraph() const
Return call graph.
void resetObjFieldSensitive()
Reset all object node as field-sensitive.
virtual void dumpAllPts()
void dumpStat()
Dump the statistics.

◆ getAllFieldsObjVars()

virtual const NodeBS & SVF::PointerAnalysis::getAllFieldsObjVars ( NodeID  id)
inlinevirtual

Definition at line 301 of file PointerAnalysis.h.

302 {
303 return pag->getAllFieldsObjVars(id);
304 }
NodeBS & getAllFieldsObjVars(const BaseObjVar *obj)
Get all fields of an object.
Definition SVFIR.cpp:573

◆ getAllValidPtrs()

OrderedNodeSet & SVF::PointerAnalysis::getAllValidPtrs ( )
inline

Get all Valid Pointers for resolution.

Definition at line 170 of file PointerAnalysis.h.

171 {
172 return pag->getAllValidPtrs();
173 }
OrderedNodeSet & getAllValidPtrs()
Return valid pointers.
Definition SVFIR.h:206

◆ getAnalysisTy()

PTATY SVF::PointerAnalysis::getAnalysisTy ( ) const
inline

Type of pointer analysis.

Definition at line 144 of file PointerAnalysis.h.

145 {
146 return ptaTy;
147 }

◆ getBaseObjVarID()

NodeID SVF::PointerAnalysis::getBaseObjVarID ( NodeID  id)
inline

Definition at line 289 of file PointerAnalysis.h.

290 {
291 return pag->getBaseObjVarID(id);
292 }
NodeID getBaseObjVarID(NodeID id) const
Base and Offset methods for Value and Object node.
Definition SVFIR.h:552

◆ getCallGraph()

CallGraph * SVF::PointerAnalysis::getCallGraph ( ) const
inline

Return call graph.

Definition at line 130 of file PointerAnalysis.h.

131 {
132 return callgraph;
133 }

◆ getCallGraphSCC()

CallGraphSCC * SVF::PointerAnalysis::getCallGraphSCC ( ) const
inline

Return call graph SCC.

Definition at line 135 of file PointerAnalysis.h.

136 {
137 return callGraphSCC;
138 }

◆ getCallGraphSCCRepNode()

NodeID SVF::PointerAnalysis::getCallGraphSCCRepNode ( NodeID  id) const
inline

Get SCC rep node of a SVFG node.

Definition at line 359 of file PointerAnalysis.h.

360 {
361 return callGraphSCC->repNode(id);
362 }

◆ getCHGraph()

CommonCHGraph * SVF::PointerAnalysis::getCHGraph ( ) const
inline

get CHGraph

Definition at line 385 of file PointerAnalysis.h.

386 {
387 return chgraph;
388 }

◆ getFIObjVar()

NodeID SVF::PointerAnalysis::getFIObjVar ( NodeID  id)
inline

Definition at line 293 of file PointerAnalysis.h.

294 {
295 return pag->getFIObjVar(id);
296 }
NodeID getFIObjVar(const BaseObjVar *obj) const
Get a field-insensitive obj SVFIR node according to a mem obj.
Definition SVFIR.h:522

◆ getFunPtr()

NodeID SVF::PointerAnalysis::getFunPtr ( const CallICFGNode cs) const
inlineprotected

Return function pointer PAGNode at a callsite cs.

Definition at line 234 of file PointerAnalysis.h.

235 {
236 return pag->getFunPtr(cs);
237 }
NodeID getFunPtr(const CallICFGNode *cs) const
Definition SVFIR.h:455

◆ getGepObjVar()

NodeID SVF::PointerAnalysis::getGepObjVar ( NodeID  id,
const APOffset ap 
)
inline

Definition at line 297 of file PointerAnalysis.h.

298 {
299 return pag->getGepObjVar(id, ap);
300 }
const GepObjVar * getGepObjVar(NodeID id) const
Definition SVFIR.h:167

◆ getICFG()

ICFG * SVF::PointerAnalysis::getICFG ( ) const
inline

Get ICFG.

Definition at line 120 of file PointerAnalysis.h.

121 {
122 return pag->getICFG();
123 }
ICFG * getICFG() const
Definition SVFIR.h:229

◆ getImplTy()

PTAImplTy SVF::PointerAnalysis::getImplTy ( ) const
inline

Return implementation type of the pointer analysis.

Definition at line 150 of file PointerAnalysis.h.

151 {
152 return ptaImplTy;
153 }

◆ getIndCallMap()

CallEdgeMap & SVF::PointerAnalysis::getIndCallMap ( )
inline

Get callees from an indirect callsite.

Definition at line 331 of file PointerAnalysis.h.

332 {
333 return getCallGraph()->getIndCallMap();
334 }
CallEdgeMap & getIndCallMap()
Get callees from an indirect callsite.
Definition CallGraph.h:331

◆ getIndCSCallees()

const FunctionSet & SVF::PointerAnalysis::getIndCSCallees ( const CallICFGNode cs) const
inline

Definition at line 339 of file PointerAnalysis.h.

340 {
341 return getCallGraph()->getIndCSCallees(cs);
342 }
const FunctionSet & getIndCSCallees(const CallICFGNode *cs) const
Definition CallGraph.h:339

◆ getIndirectCallsites()

const CallSiteToFunPtrMap & SVF::PointerAnalysis::getIndirectCallsites ( ) const
inlineprotected

Return all indirect callsites.

Definition at line 229 of file PointerAnalysis.h.

230 {
231 return pag->getIndirectCallsites();
232 }
const CallSiteToFunPtrMap & getIndirectCallsites() const
Add/get indirect callsites.
Definition SVFIR.h:451

◆ getNumOfResolvedIndCallEdge()

u32_t SVF::PointerAnalysis::getNumOfResolvedIndCallEdge ( ) const
inline

Return number of resolved indirect call edges.

Definition at line 125 of file PointerAnalysis.h.

126 {
128 }
u32_t getNumOfResolvedIndCallEdge() const
Definition CallGraph.h:351

◆ getPAG()

SVFIR * SVF::PointerAnalysis::getPAG ( ) const
inline

Get/set SVFIR

Definition at line 157 of file PointerAnalysis.h.

158 {
159 return pag;
160 }

◆ getPts()

virtual const PointsTo & SVF::PointerAnalysis::getPts ( NodeID  ptr)
pure virtual

Get points-to targets of a pointer. It needs to be implemented in child class.

Implemented in SVF::Andersen, SVF::BVDataPTAImpl, SVF::Steensgaard, SVF::CondPTAImpl< Cond >, and SVF::CondPTAImpl< ContextCond >.

◆ getRevPts()

virtual const NodeSet & SVF::PointerAnalysis::getRevPts ( NodeID  nodeId)
pure virtual

Given an object, get all the nodes having whose pointsto contains the object. Similar to getPts, this also needs to be implemented in child classes.

Implemented in SVF::CFLAlias, SVF::BVDataPTAImpl, SVF::CondPTAImpl< Cond >, and SVF::CondPTAImpl< ContextCond >.

◆ getStat()

PTAStat * SVF::PointerAnalysis::getStat ( ) const
inline

Get PTA stat.

Definition at line 164 of file PointerAnalysis.h.

165 {
166 return stat;
167 }

◆ getVFnsFromCHA()

void PointerAnalysis::getVFnsFromCHA ( const CallICFGNode cs,
VFunSet vfns 
)

Definition at line 422 of file PointerAnalysis.cpp.

423{
426}
virtual const VFunSet & getCSVFsBasedonCHA(const CallICFGNode *cs)=0
virtual bool csHasVFnsBasedonCHA(const CallICFGNode *cs)=0

◆ getVFnsFromPts()

void PointerAnalysis::getVFnsFromPts ( const CallICFGNode cs,
const PointsTo target,
VFunSet vfns 
)

Definition at line 431 of file PointerAnalysis.cpp.

432{
433
435 {
438 for (PointsTo::iterator it = target.begin(), eit = target.end(); it != eit; ++it)
439 {
440 const SVFVar* ptdnode = pag->getSVFVar(*it);
441 const GlobalObjVar* pVar = nullptr;
443 {
445
446 }
447 else if (isa<ValVar>(ptdnode) &&
449 pag->getBaseValVar(ptdnode->getId())))
450 {
453 pag->getBaseValVar(ptdnode->getId()))));
454 }
455
456 if (pVar && chaVtbls.find(pVar) != chaVtbls.end())
457 vtbls.insert(pVar);
458 }
460 }
461}
virtual const VTableSet & getCSVtblsBasedonCHA(const CallICFGNode *cs)=0
virtual void getVFnsFromVtbls(const CallICFGNode *cs, const VTableSet &vtbls, VFunSet &virtualFunctions)=0
virtual bool csHasVtblsBasedonCHA(const CallICFGNode *cs)=0
const BaseObjVar * getBaseObject(NodeID id) const
Definition SVFIR.h:496
const ValVar * getBaseValVar(NodeID id) const
Definition SVFIR.h:506
const ObjVar * getObjVarOfValVar(const ValVar *valVar)
Definition SVFUtil.cpp:435
Set< const GlobalObjVar * > VTableSet
Definition CHG.h:46

◆ hasIndCSCallees()

bool SVF::PointerAnalysis::hasIndCSCallees ( const CallICFGNode cs) const
inline

Definition at line 335 of file PointerAnalysis.h.

336 {
337 return getCallGraph()->hasIndCSCallees(cs);
338 }
bool hasIndCSCallees(const CallICFGNode *cs) const
Definition CallGraph.h:335

◆ initialize()

void PointerAnalysis::initialize ( )
virtual

Initialization of a pointer analysis, including building symbol table and SVFIR etc.

Initialization of pointer analysis

initialise pta call graph for every pointer analysis instance

Reimplemented in SVF::CFLAlias, SVF::CFLVF, SVF::Andersen, SVF::AndersenWaveDiff, SVF::AndersenSFR, SVF::ContextDDA, SVF::FlowDDA, SVF::AndersenBase, SVF::FlowSensitive, SVF::TypeAnalysis, and SVF::VersionedFlowSensitive.

Definition at line 106 of file PointerAnalysis.cpp.

107{
108 assert(pag && "SVFIR has not been built!");
109
110 chgraph = pag->getCHG();
111
114 {
116 callgraph = bd.buildThreadCallGraph();
117 }
118 else
119 {
121 callgraph = bd.buildPTACallGraph();
122 }
124
125 // dump callgraph
127 getCallGraph()->dump("callgraph_initial");
128}
static const Option< bool > EnableThreadCallGraph
Definition Options.h:129
void callGraphSCCDetection()
PTACallGraph SCC related methods.
CommonCHGraph * getCHG()
Definition SVFIR.h:239

◆ inSameCallGraphSCC()

bool SVF::PointerAnalysis::inSameCallGraphSCC ( const FunObjVar fun1,
const FunObjVar fun2 
)
inline

Return TRUE if this edge is inside a PTACallGraph SCC, i.e., src node and dst node are in the same SCC on the SVFG.

Definition at line 364 of file PointerAnalysis.h.

365 {
366 const CallGraphNode* src = callgraph->getCallGraphNode(fun1);
367 const CallGraphNode* dst = callgraph->getCallGraphNode(fun2);
368 return (getCallGraphSCCRepNode(src->getId()) == getCallGraphSCCRepNode(dst->getId()));
369 }
const CallGraphNode * getCallGraphNode(const std::string &name) const
Get call graph node.
NodeID getCallGraphSCCRepNode(NodeID id) const
Get SCC rep node of a SVFG node.

◆ isArrayMemObj()

bool SVF::PointerAnalysis::isArrayMemObj ( NodeID  id) const
inline

Definition at line 275 of file PointerAnalysis.h.

276 {
277 const BaseObjVar* obj = pag->getBaseObject(id);
278 assert(obj && "base object is null??");
279 return obj->isArray();
280 }

◆ isBlkObjOrConstantObj()

virtual bool SVF::PointerAnalysis::isBlkObjOrConstantObj ( NodeID  ptd) const
inlinevirtual

Definition at line 262 of file PointerAnalysis.h.

263 {
265 }
bool isBlkObjOrConstantObj(NodeID id) const
Get black hole and constant id.
Definition SVFIR.h:535

◆ isFieldInsensitive()

bool SVF::PointerAnalysis::isFieldInsensitive ( NodeID  id) const
inline

Definition at line 310 of file PointerAnalysis.h.

311 {
312 const BaseObjVar* baseObj = pag->getBaseObject(id);
313 return baseObj->isFieldInsensitive();
314 }
bool isFieldInsensitive() const
Return true if its field limit is 0.

◆ isFIObjNode()

bool SVF::PointerAnalysis::isFIObjNode ( NodeID  id) const
inline

For field-sensitivity

Definition at line 285 of file PointerAnalysis.h.

286 {
287 return (SVFUtil::isa<BaseObjVar>(pag->getSVFVar(id)));
288 }

◆ isHeapMemObj()

bool SVF::PointerAnalysis::isHeapMemObj ( NodeID  id) const
inline

Whether this object is heap or array.

Definition at line 270 of file PointerAnalysis.h.

271 {
272 return pag->getBaseObject(id) && SVFUtil::isa<HeapObjVar, DummyObjVar>(pag->getBaseObject(id));
273 }

◆ isInRecursion()

bool SVF::PointerAnalysis::isInRecursion ( const FunObjVar fun) const
inline

Definition at line 370 of file PointerAnalysis.h.

371 {
372 return callGraphSCC->isInCycle(callgraph->getCallGraphNode(fun)->getId());
373 }

◆ isLocalVarInRecursiveFun()

bool PointerAnalysis::isLocalVarInRecursiveFun ( NodeID  id) const

Whether a local variable is in function recursions.

Return TRUE if this node is a local variable of recursive function.

Definition at line 134 of file PointerAnalysis.cpp.

135{
137 assert(baseObjVar && "base object not found!!");
138 if(SVFUtil::isa<StackObjVar>(baseObjVar))
139 {
140 if(const FunObjVar* svffun = pag->getSVFVar(id)->getFunction())
141 {
142 return callGraphSCC->isInCycle(getCallGraph()->getCallGraphNode(svffun)->getId());
143 }
144 }
145 return false;
146}
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.

◆ mayAlias() [1/2]

bool SVF::PointerAnalysis::mayAlias ( const SVFVar V1,
const SVFVar V2 
)
inline

Convenience bool wrappers: return true if the two operands may/must/partial alias.

Definition at line 205 of file PointerAnalysis.h.

206 {
207 return alias(V1, V2)!= AliasResult::NoAlias;
208 }
virtual AliasResult alias(const SVFVar *V1, const SVFVar *V2)=0
Interface exposed to users of our pointer analysis, given Value infos.
@ NoAlias
Definition SVFType.h:637

◆ mayAlias() [2/2]

bool SVF::PointerAnalysis::mayAlias ( NodeID  node1,
NodeID  node2 
)
inline

Definition at line 209 of file PointerAnalysis.h.

210 {
212 }

◆ printIndCSTargets() [1/2]

void PointerAnalysis::printIndCSTargets ( )

Print all indirect callsites

Definition at line 341 of file PointerAnalysis.cpp.

342{
343 outs() << "==================Function Pointer Targets==================\n";
345 CallEdgeMap::const_iterator it = callEdges.begin();
346 CallEdgeMap::const_iterator eit = callEdges.end();
347 for (; it != eit; ++it)
348 {
349 const CallICFGNode* cs = it->first;
350 const FunctionSet& targets = it->second;
352 }
353
355 CallSiteToFunPtrMap::const_iterator csIt = indCS.begin();
356 CallSiteToFunPtrMap::const_iterator csEit = indCS.end();
357 for (; csIt != csEit; ++csIt)
358 {
359 const CallICFGNode* cs = csIt->first;
360 if (hasIndCSCallees(cs) == false)
361 {
362 outs() << "\nNodeID: " << csIt->second;
363 outs() << "\nCallSite: ";
364 outs() << cs->toString();
365 outs() << "\tLocation: " << cs->getSourceLoc();
366 outs() << "\n\t!!!has no targets!!!\n";
367 }
368 }
369}
const std::string toString() const override
Definition ICFG.cpp:128
const std::string getSourceLoc() const override
Definition ICFGNode.h:570
OrderedMap< const CallICFGNode *, FunctionSet > CallEdgeMap
Set< const FunObjVar * > FunctionSet
const CallSiteToFunPtrMap & getIndirectCallsites() const
Return all indirect callsites.
bool hasIndCSCallees(const CallICFGNode *cs) const
SVFIR::CallSiteToFunPtrMap CallSiteToFunPtrMap

◆ printIndCSTargets() [2/2]

void PointerAnalysis::printIndCSTargets ( const CallICFGNode cs,
const FunctionSet targets 
)

Print targets of a function pointer.

Print indirect call targets at an indirect callsite

Definition at line 312 of file PointerAnalysis.cpp.

313{
314 outs() << "\nNodeID: " << getFunPtr(cs);
315 outs() << "\nCallSite: ";
316 outs() << cs->toString();
317 outs() << "\tLocation: " << cs->getSourceLoc();
318 outs() << "\t with Targets: ";
319
320 if (!targets.empty())
321 {
322 FunctionSet::const_iterator fit = targets.begin();
323 FunctionSet::const_iterator feit = targets.end();
324 for (; fit != feit; ++fit)
325 {
326 const FunObjVar* callee = *fit;
327 outs() << "\n\t" << callee->getName();
328 }
329 }
330 else
331 {
332 outs() << "\n\tNo Targets!";
333 }
334
335 outs() << "\n";
336}
NodeID getFunPtr(const CallICFGNode *cs) const
Return function pointer PAGNode at a callsite cs.

◆ printStat()

bool SVF::PointerAnalysis::printStat ( )
inline

Whether print statistics.

Definition at line 318 of file PointerAnalysis.h.

319 {
320 return print_stat;
321 }

◆ PTAName()

virtual const std::string SVF::PointerAnalysis::PTAName ( ) const
inlinevirtual

Return PTA name.

Reimplemented in SVF::Andersen, SVF::ContextDDA, SVF::FlowDDA, SVF::FlowSensitive, and SVF::VersionedFlowSensitive.

Definition at line 379 of file PointerAnalysis.h.

380 {
381 return "Pointer Analysis";
382 }

◆ resetObjFieldSensitive()

void PointerAnalysis::resetObjFieldSensitive ( )
protected

Reset all object node as field-sensitive.

Reset field sensitivity

Definition at line 151 of file PointerAnalysis.cpp.

152{
153 for (SVFIR::iterator nIter = pag->begin(); nIter != pag->end(); ++nIter)
154 {
155 if(ObjVar* node = SVFUtil::dyn_cast<ObjVar>(nIter->second))
156 const_cast<BaseObjVar*>(pag->getBaseObject(node->getId()))->setFieldSensitive();
157 }
158}
iterator begin()
Iterators.
IDToNodeMapTy::iterator iterator
Node Iterators.

◆ resolveCPPIndCalls()

void PointerAnalysis::resolveCPPIndCalls ( const CallICFGNode cs,
const PointsTo target,
CallEdgeMap newEdges 
)
virtual

Resolve cpp indirect call edges.

Definition at line 488 of file PointerAnalysis.cpp.

489{
490 assert(cs->isVirtualCall() && "not cpp virtual call");
491
494 getVFnsFromCHA(cs, vfns);
495 else
498}
bool isVirtualCall() const
Definition ICFGNode.h:509
static const Option< bool > ConnectVCallOnCHA
Definition Options.h:130
void getVFnsFromPts(const CallICFGNode *cs, const PointsTo &target, VFunSet &vfns)
void connectVCallToVFns(const CallICFGNode *cs, const VFunSet &vfns, CallEdgeMap &newEdges)
void getVFnsFromCHA(const CallICFGNode *cs, VFunSet &vfns)
Set< const FunObjVar * > VFunSet
Definition CHG.h:47

◆ resolveIndCalls()

void PointerAnalysis::resolveIndCalls ( const CallICFGNode cs,
const PointsTo target,
CallEdgeMap newEdges 
)
virtual

Resolve indirect call edges.

Resolve indirect calls

discover indirect pointer target

Definition at line 376 of file PointerAnalysis.cpp.

377{
378
379 assert(pag->isIndirectCallSites(cs) && "not an indirect callsite?");
381 for (PointsTo::iterator ii = target.begin(), ie = target.end();
382 ii != ie; ii++)
383 {
384
386 {
387 writeWrnMsg("Resolved Indirect Call Edges are Out-Of-Budget, please increase the limit");
388 return;
389 }
390
391 if(const ObjVar* objPN = pag->getObjVar(*ii))
392 {
393 const BaseObjVar* obj = pag->getBaseObject(objPN->getId());
394
395 if(obj->isFunction())
396 {
397 const FunObjVar* calleefun = SVFUtil::cast<FunObjVar>(obj)->getFunction();
399
400 if(SVFUtil::matchArgs(cs, callee) == false)
401 continue;
402
403 if(0 == getIndCallMap()[cs].count(callee))
404 {
405 newEdges[cs].insert(callee);
406 getIndCallMap()[cs].insert(callee);
407
409 // FIXME: do we need to update llvm call graph here?
410 // The indirect call is maintained by ourself, We may update llvm's when we need to
411 //PTACallGraphNode* callgraphNode = callgraph->getOrInsertFunction(cs.getCaller());
412 //callgraphNode->addCalledFunction(cs,callgraph->getOrInsertFunction(callee));
413 }
414 }
415 }
416 }
417}
int count
Definition cJSON.h:216
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
static const Option< u32_t > IndirectCallLimit
Definition Options.h:125
u32_t getNumOfResolvedIndCallEdge() const
Return number of resolved indirect call edges.
bool isIndirectCallSites(const CallICFGNode *cs) const
Definition SVFIR.h:467
const ObjVar * getObjVar(NodeID id) const
Definition SVFIR.h:147
bool matchArgs(const CallICFGNode *cs, const FunObjVar *callee)
Definition SVFUtil.cpp:312
void writeWrnMsg(const std::string &msg)
Writes a message run through wrnMsg.
Definition SVFUtil.cpp:72

◆ setObjFieldInsensitive()

void SVF::PointerAnalysis::setObjFieldInsensitive ( NodeID  id)
inline

Definition at line 305 of file PointerAnalysis.h.

306 {
307 BaseObjVar* baseObj = const_cast<BaseObjVar*>(pag->getBaseObject(id));
308 baseObj->setFieldInsensitive();
309 }

◆ validateExpectedFailureTests()

void PointerAnalysis::validateExpectedFailureTests ( std::string  fun)
protectedvirtual

Pointer analysis validator

Definition at line 569 of file PointerAnalysis.cpp.

570{
571
572 if (const FunObjVar* checkFun = pag->getFunObjVar(fun))
573 {
574 if(!checkFun->isUncalledFunction())
575 outs() << "[" << this->PTAName() << "] Checking " << fun << "\n";
576
577 for(const CallICFGNode* callNode : pag->getCallSiteSet())
578 {
579 if (callNode->getCalledFunction() == checkFun)
580 {
581 assert(callNode->arg_size() == 2
582 && "arguments should be two pointers!!");
583 const SVFVar* V1 = callNode->getArgument(0);
584 const SVFVar* V2 = callNode->getArgument(1);
585 AliasResult aliasRes = alias(V1->getId(), V2->getId());
586
587 bool expectedFailure = false;
589 {
590 // change to must alias when our analysis support it
592 expectedFailure = true;
593 }
594 else if (fun == aliasTestFailNoAlias || fun == aliasTestFailNoAliasMangled)
595 {
596 // change to partial alias when our analysis support it
598 expectedFailure = true;
599 }
600 else
601 assert(false && "not supported alias check!!");
602
603 NodeID id1 = V1->getId();
604 NodeID id2 = V2->getId();
605
606 if (expectedFailure)
607 outs() << sucMsg("\t EXPECTED-FAILURE :") << fun << " check <id:" << id1 << ", id:" << id2 << "> at ("
608 << callNode->getSourceLoc() << ")\n";
609 else
610 {
611 SVFUtil::errs() << errMsg("\t UNEXPECTED FAILURE :") << fun << " check <id:" << id1 << ", id:" << id2 << "> at ("
612 << callNode->getSourceLoc() << ")\n";
613 assert(false && "test case failed!");
614 }
615 }
616 }
617 }
618}
static const std::string aliasTestFailNoAlias
static const std::string aliasTestFailMayAlias
static const std::string aliasTestFailMayAliasMangled
virtual const std::string PTAName() const
Return PTA name.
static const std::string aliasTestFailNoAliasMangled
const FunObjVar * getFunObjVar(const std::string &name)
Definition SVFIR.cpp:48
std::string sucMsg(const std::string &msg)
Returns successful message by converting a string into green string output.
Definition SVFUtil.cpp:59
std::string errMsg(const std::string &msg)
Print error message by converting a string into red string output.
Definition SVFUtil.cpp:82
std::ostream & errs()
Overwrite llvm::errs()
Definition SVFUtil.h:58
AliasResult
Definition SVFType.h:636
@ PartialAlias
Definition SVFType.h:640
@ MustAlias
Definition SVFType.h:639
@ MayAlias
Definition SVFType.h:638

◆ validateSuccessTests()

void PointerAnalysis::validateSuccessTests ( std::string  fun)
protectedvirtual

Find the alias check functions annotated in the C files check whether the alias analysis results consistent with the alias check function itself

Definition at line 504 of file PointerAnalysis.cpp.

505{
506 // check for must alias cases, whether our alias analysis produce the correct results
507 if (const FunObjVar* checkFun = pag->getFunObjVar(fun))
508 {
509 if(!checkFun->isUncalledFunction())
510 outs() << "[" << this->PTAName() << "] Checking " << fun << "\n";
511
512 for(const CallICFGNode* callNode : pag->getCallSiteSet())
513 {
514 if (callNode->getCalledFunction() == checkFun)
515 {
516 assert(callNode->getNumArgOperands() == 2
517 && "arguments should be two pointers!!");
518 const SVFVar* V1 = callNode->getArgument(0);
519 const SVFVar* V2 = callNode->getArgument(1);
520 AliasResult aliasRes = alias(V1->getId(), V2->getId());
521
522 bool checkSuccessful = false;
523 if (fun == aliasTestMayAlias || fun == aliasTestMayAliasMangled)
524 {
526 checkSuccessful = true;
527 }
528 else if (fun == aliasTestNoAlias || fun == aliasTestNoAliasMangled)
529 {
531 checkSuccessful = true;
532 }
533 else if (fun == aliasTestMustAlias || fun == aliasTestMustAliasMangled)
534 {
535 // change to must alias when our analysis support it
537 checkSuccessful = true;
538 }
539 else if (fun == aliasTestPartialAlias || fun == aliasTestPartialAliasMangled)
540 {
541 // change to partial alias when our analysis support it
543 checkSuccessful = true;
544 }
545 else
546 assert(false && "not supported alias check!!");
547
548 NodeID id1 = V1->getId();
549 NodeID id2 = V2->getId();
550
551 if (checkSuccessful)
552 outs() << sucMsg("\t SUCCESS :") << fun << " check <id:" << id1 << ", id:" << id2 << "> at ("
553 << callNode->getSourceLoc() << ")\n";
554 else
555 {
556 SVFUtil::errs() << errMsg("\t FAILURE :") << fun
557 << " check <id:" << id1 << ", id:" << id2
558 << "> at (" << callNode->getSourceLoc() << ")\n";
559 assert(false && "test case failed!");
560 }
561 }
562 }
563 }
564}
static const std::string aliasTestNoAliasMangled
static const std::string aliasTestMayAliasMangled
static const std::string aliasTestMustAlias
static const std::string aliasTestMayAlias
static const std::string aliasTestPartialAlias
static const std::string aliasTestNoAlias
static const std::string aliasTestPartialAliasMangled
static const std::string aliasTestMustAliasMangled

◆ validateTests()

void PointerAnalysis::validateTests ( )
protectedvirtual

Member Data Documentation

◆ alias_validation

bool SVF::PointerAnalysis::alias_validation
protected

Flag for validating points-to/alias results.

Definition at line 96 of file PointerAnalysis.h.

◆ aliasTestFailMayAlias

const std::string PointerAnalysis::aliasTestFailMayAlias = "EXPECTEDFAIL_MAYALIAS"
static

Definition at line 80 of file PointerAnalysis.h.

◆ aliasTestFailMayAliasMangled

const std::string PointerAnalysis::aliasTestFailMayAliasMangled = "_Z21EXPECTEDFAIL_MAYALIASPvS_"
static

Definition at line 81 of file PointerAnalysis.h.

◆ aliasTestFailNoAlias

const std::string PointerAnalysis::aliasTestFailNoAlias = "EXPECTEDFAIL_NOALIAS"
static

Definition at line 82 of file PointerAnalysis.h.

◆ aliasTestFailNoAliasMangled

const std::string PointerAnalysis::aliasTestFailNoAliasMangled = "_Z20EXPECTEDFAIL_NOALIASPvS_"
static

Definition at line 83 of file PointerAnalysis.h.

◆ aliasTestMayAlias

const std::string PointerAnalysis::aliasTestMayAlias = "MAYALIAS"
static

Definition at line 72 of file PointerAnalysis.h.

◆ aliasTestMayAliasMangled

const std::string PointerAnalysis::aliasTestMayAliasMangled = "_Z8MAYALIASPvS_"
static

Definition at line 73 of file PointerAnalysis.h.

◆ aliasTestMustAlias

const std::string PointerAnalysis::aliasTestMustAlias = "MUSTALIAS"
static

Definition at line 78 of file PointerAnalysis.h.

◆ aliasTestMustAliasMangled

const std::string PointerAnalysis::aliasTestMustAliasMangled = "_Z9MUSTALIASPvS_"
static

Definition at line 79 of file PointerAnalysis.h.

◆ aliasTestNoAlias

const std::string PointerAnalysis::aliasTestNoAlias = "NOALIAS"
static

Definition at line 74 of file PointerAnalysis.h.

◆ aliasTestNoAliasMangled

const std::string PointerAnalysis::aliasTestNoAliasMangled = "_Z7NOALIASPvS_"
static

Definition at line 75 of file PointerAnalysis.h.

◆ aliasTestPartialAlias

const std::string PointerAnalysis::aliasTestPartialAlias = "PARTIALALIAS"
static

Definition at line 76 of file PointerAnalysis.h.

◆ aliasTestPartialAliasMangled

const std::string PointerAnalysis::aliasTestPartialAliasMangled = "_Z12PARTIALALIASPvS_"
static

Definition at line 77 of file PointerAnalysis.h.

◆ callgraph

CallGraph* SVF::PointerAnalysis::callgraph
protected

Call graph used for pointer analysis.

Definition at line 110 of file PointerAnalysis.h.

◆ callGraphSCC

CallGraphSCC* SVF::PointerAnalysis::callGraphSCC
protected

SCC for PTACallGraph.

Definition at line 112 of file PointerAnalysis.h.

◆ chgraph

CommonCHGraph* SVF::PointerAnalysis::chgraph
protected

CHGraph.

Definition at line 116 of file PointerAnalysis.h.

◆ icfg

ICFG* SVF::PointerAnalysis::icfg
protected

Interprocedural control-flow graph.

Definition at line 114 of file PointerAnalysis.h.

◆ OnTheFlyIterBudgetForStat

u32_t SVF::PointerAnalysis::OnTheFlyIterBudgetForStat
protected

Flag for iteration budget for on-the-fly statistics.

Definition at line 98 of file PointerAnalysis.h.

◆ pag

SVFIR * PointerAnalysis::pag = nullptr
staticprotected

SVFIR.

Definition at line 102 of file PointerAnalysis.h.

◆ print_stat

bool SVF::PointerAnalysis::print_stat
protected

User input flags.

Flag for printing the statistic results

Definition at line 94 of file PointerAnalysis.h.

◆ ptaImplTy

PTAImplTy SVF::PointerAnalysis::ptaImplTy
protected

PTA implementation type.

Definition at line 106 of file PointerAnalysis.h.

◆ ptaTy

PTATY SVF::PointerAnalysis::ptaTy
protected

Pointer analysis Type.

Definition at line 104 of file PointerAnalysis.h.

◆ stat

PTAStat* SVF::PointerAnalysis::stat
protected

Statistics.

Definition at line 108 of file PointerAnalysis.h.


The documentation for this class was generated from the following files: