Static Value-Flow Analysis
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
SVF::AliasDDAClient Class Reference

#include <DDAClient.h>

Inheritance diagram for SVF::AliasDDAClient:
SVF::DDAClient

Public Types

typedef OrderedSet< const PAGNode * > PAGNodeSet
 

Public Member Functions

 AliasDDAClient (SVFModule *module)
 
 ~AliasDDAClient ()
 
virtual OrderedNodeSetcollectCandidateQueries (SVFIR *pag)
 Only collect function pointers as query candidates. More...
 
virtual void performStat (PointerAnalysis *pta)
 
- Public Member Functions inherited from SVF::DDAClient
 DDAClient (SVFModule *mod)
 
virtual ~DDAClient ()
 
virtual void initialise (SVFModule *)
 
const OrderedNodeSetgetCandidateQueries () const
 Get candidate queries. More...
 
virtual void handleStatement (const SVFGNode *, NodeID)
 Call back used by DDAVFSolver. More...
 
void setPAG (SVFIR *g)
 Set SVFIR graph. More...
 
void setCurrentQueryPtr (NodeID ptr)
 Set the pointer being queried. More...
 
void setQuery (NodeID ptr)
 Set pointer to be queried by DDA analysis. More...
 
SVFModulegetModule () const
 Get LLVM module. More...
 
virtual void answerQueries (PointerAnalysis *pta)
 
virtual void collectWPANum (SVFModule *)
 

Private Types

typedef OrderedMap< NodeID, const CallICFGNode * > VTablePtrToCallSiteMap
 

Private Attributes

VTablePtrToCallSiteMap vtableToCallSiteMap
 
PAGNodeSet loadSrcNodes
 
PAGNodeSet storeDstNodes
 
PAGNodeSet gepSrcNodes
 

Additional Inherited Members

- Protected Member Functions inherited from SVF::DDAClient
void addCandidate (NodeID id)
 
- Protected Attributes inherited from SVF::DDAClient
SVFIRpag
 SVFIR graph used by current DDA analysis. More...
 
SVFModulemodule
 LLVM module. More...
 
NodeID curPtr
 current pointer being queried More...
 
OrderedNodeSet candidateQueries
 store all candidate pointers to be queried More...
 

Detailed Description

DDA client with function pointers as query candidates.

Definition at line 144 of file DDAClient.h.

Member Typedef Documentation

◆ PAGNodeSet

Definition at line 148 of file DDAClient.h.

◆ VTablePtrToCallSiteMap

Definition at line 159 of file DDAClient.h.

Constructor & Destructor Documentation

◆ AliasDDAClient()

SVF::AliasDDAClient::AliasDDAClient ( SVFModule module)
inline

Definition at line 150 of file DDAClient.h.

150 : DDAClient(module) {}
DDAClient(SVFModule *mod)
Definition: DDAClient.h:51
SVFModule * module
LLVM module.
Definition: DDAClient.h:112

◆ ~AliasDDAClient()

SVF::AliasDDAClient::~AliasDDAClient ( )
inline

Definition at line 151 of file DDAClient.h.

151 {}

Member Function Documentation

◆ collectCandidateQueries()

OrderedNodeSet & AliasDDAClient::collectCandidateQueries ( SVFIR pag)
virtual

Only collect function pointers as query candidates.

Reimplemented from SVF::DDAClient.

Definition at line 176 of file DDAClient.cpp.

177 {
178  setPAG(pag);
180  for (SVFStmt::SVFStmtSetTy::iterator iter = loads.begin(), eiter =
181  loads.end(); iter != eiter; ++iter)
182  {
183  PAGNode* loadsrc = (*iter)->getSrcNode();
184  loadSrcNodes.insert(loadsrc);
185  addCandidate(loadsrc->getId());
186  }
187 
189  for (SVFStmt::SVFStmtSetTy::iterator iter = stores.begin(), eiter =
190  stores.end(); iter != eiter; ++iter)
191  {
192  PAGNode* storedst = (*iter)->getDstNode();
193  storeDstNodes.insert(storedst);
194  addCandidate(storedst->getId());
195  }
197  for (SVFStmt::SVFStmtSetTy::iterator iter = geps.begin(), eiter =
198  geps.end(); iter != eiter; ++iter)
199  {
200  PAGNode* gepsrc = (*iter)->getSrcNode();
201  gepSrcNodes.insert(gepsrc);
202  addCandidate(gepsrc->getId());
203  }
204  return candidateQueries;
205 }
PAGNodeSet loadSrcNodes
Definition: DDAClient.h:161
PAGNodeSet storeDstNodes
Definition: DDAClient.h:162
PAGNodeSet gepSrcNodes
Definition: DDAClient.h:163
void setPAG(SVFIR *g)
Set SVFIR graph.
Definition: DDAClient.h:79
SVFIR * pag
SVFIR graph used by current DDA analysis.
Definition: DDAClient.h:111
void addCandidate(NodeID id)
Definition: DDAClient.h:105
OrderedNodeSet candidateQueries
store all candidate pointers to be queried
Definition: DDAClient.h:114
NodeID getId() const
Get ID.
Definition: GenericGraph.h:260
SVFStmt::SVFStmtSetTy & getSVFStmtSet(SVFStmt::PEDGEK kind)
Get/set methods to get SVFStmts based on their kinds and ICFGNodes.
Definition: SVFIR.h:201
GenericNode< SVFVar, SVFStmt >::GEdgeSetTy SVFStmtSetTy

◆ performStat()

void AliasDDAClient::performStat ( PointerAnalysis pta)
virtual

Reimplemented from SVF::DDAClient.

Definition at line 207 of file DDAClient.cpp.

208 {
209 
210  for(PAGNodeSet::const_iterator lit = loadSrcNodes.begin(); lit!=loadSrcNodes.end(); lit++)
211  {
212  for(PAGNodeSet::const_iterator sit = storeDstNodes.begin(); sit!=storeDstNodes.end(); sit++)
213  {
214  const PAGNode* node1 = *lit;
215  const PAGNode* node2 = *sit;
216  if(node1->hasValue() && node2->hasValue())
217  {
218  AliasResult result = pta->alias(node1->getId(),node2->getId());
219 
220  outs() << "\n=================================================\n";
221  outs() << "Alias Query for (" << node1->getValue()->toString() << ",";
222  outs() << node2->getValue()->toString() << ") \n";
223  outs() << "[NodeID:" << node1->getId() << ", NodeID:" << node2->getId() << " " << result << "]\n";
224  outs() << "=================================================\n";
225 
226  }
227  }
228  }
229 }
virtual AliasResult alias(const SVFValue *V1, const SVFValue *V2)=0
Interface exposed to users of our pointer analysis, given Value infos.
std::string toString() const
Needs to be implemented by a SVF front end.
Definition: LLVMUtil.cpp:663
bool hasValue() const
Definition: SVFVariables.h:101
const SVFValue * getValue() const
Get/has methods of the components.
Definition: SVFVariables.h:83
std::ostream & outs()
Overwrite llvm::outs()
Definition: SVFUtil.h:50
AliasResult
Definition: SVFType.h:527

Member Data Documentation

◆ gepSrcNodes

PAGNodeSet SVF::AliasDDAClient::gepSrcNodes
private

Definition at line 163 of file DDAClient.h.

◆ loadSrcNodes

PAGNodeSet SVF::AliasDDAClient::loadSrcNodes
private

Definition at line 161 of file DDAClient.h.

◆ storeDstNodes

PAGNodeSet SVF::AliasDDAClient::storeDstNodes
private

Definition at line 162 of file DDAClient.h.

◆ vtableToCallSiteMap

VTablePtrToCallSiteMap SVF::AliasDDAClient::vtableToCallSiteMap
private

Definition at line 160 of file DDAClient.h.


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