Static Value-Flow Analysis
Loading...
Searching...
No Matches
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 ()
 ~AliasDDAClient ()
virtual OrderedNodeSet & collectCandidateQueries (SVFIR *pag)
 Only collect function pointers as query candidates.
virtual void performStat (PointerAnalysis *pta)
Public Member Functions inherited from SVF::DDAClient
 DDAClient ()
virtual ~DDAClient ()
virtual void initialise ()
const OrderedNodeSet & getCandidateQueries () const
 Get candidate queries.
virtual void handleStatement (const SVFGNode *, NodeID)
 Call back used by DDAVFSolver.
void setPAG (SVFIR *g)
 Set SVFIR graph.
void setCurrentQueryPtr (NodeID ptr)
 Set the pointer being queried.
void setQuery (NodeID ptr)
 Set pointer to be queried by DDA analysis.
virtual void answerQueries (PointerAnalysis *pta)
virtual void collectWPANum ()

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
SVFIR * pag
 SVFIR graph used by current DDA analysis.
NodeID curPtr
 current pointer being queried
OrderedNodeSet candidateQueries
 store all candidate pointers to be queried

Detailed Description

DDA client with function pointers as query candidates.

Definition at line 139 of file DDAClient.h.

Member Typedef Documentation

◆ PAGNodeSet

Definition at line 143 of file DDAClient.h.

◆ VTablePtrToCallSiteMap

Definition at line 154 of file DDAClient.h.

Constructor & Destructor Documentation

◆ AliasDDAClient()

SVF::AliasDDAClient::AliasDDAClient ( )
inline

Definition at line 145 of file DDAClient.h.

145: DDAClient() {}

◆ ~AliasDDAClient()

SVF::AliasDDAClient::~AliasDDAClient ( )
inline

Definition at line 146 of file DDAClient.h.

146{}

Member Function Documentation

◆ collectCandidateQueries()

OrderedNodeSet & AliasDDAClient::collectCandidateQueries ( SVFIR * pag)
virtual

Only collect function pointers as query candidates.

Reimplemented from SVF::DDAClient.

Definition at line 178 of file DDAClient.cpp.

179{
180 setPAG(pag);
181 SVFStmt::SVFStmtSetTy& loads = pag->getSVFStmtSet(SVFStmt::Load);
182 for (SVFStmt::SVFStmtSetTy::iterator iter = loads.begin(), eiter =
183 loads.end(); iter != eiter; ++iter)
184 {
185 PAGNode* loadsrc = (*iter)->getSrcNode();
186 loadSrcNodes.insert(loadsrc);
187 addCandidate(loadsrc->getId());
188 }
189
190 SVFStmt::SVFStmtSetTy& stores = pag->getSVFStmtSet(SVFStmt::Store);
191 for (SVFStmt::SVFStmtSetTy::iterator iter = stores.begin(), eiter =
192 stores.end(); iter != eiter; ++iter)
193 {
194 PAGNode* storedst = (*iter)->getDstNode();
195 storeDstNodes.insert(storedst);
196 addCandidate(storedst->getId());
197 }
198 SVFStmt::SVFStmtSetTy& geps = pag->getSVFStmtSet(SVFStmt::Gep);
199 for (SVFStmt::SVFStmtSetTy::iterator iter = geps.begin(), eiter =
200 geps.end(); iter != eiter; ++iter)
201 {
202 PAGNode* gepsrc = (*iter)->getSrcNode();
203 gepSrcNodes.insert(gepsrc);
204 addCandidate(gepsrc->getId());
205 }
206 return candidateQueries;
207}
PAGNodeSet loadSrcNodes
Definition DDAClient.h:156
PAGNodeSet storeDstNodes
Definition DDAClient.h:157
PAGNodeSet gepSrcNodes
Definition DDAClient.h:158
void setPAG(SVFIR *g)
Set SVFIR graph.
Definition DDAClient.h:79
SVFIR * pag
SVFIR graph used by current DDA analysis.
Definition DDAClient.h:107
void addCandidate(NodeID id)
Definition DDAClient.h:101
OrderedNodeSet candidateQueries
store all candidate pointers to be queried
Definition DDAClient.h:109
GenericNode< SVFVar, SVFStmt >::GEdgeSetTy SVFStmtSetTy
NodeID getId() const
Get ID.
Definition SVFValue.h:158
SVFVar PAGNode
Definition IRGraph.h:40

◆ performStat()

void AliasDDAClient::performStat ( PointerAnalysis * pta)
virtual

Reimplemented from SVF::DDAClient.

Definition at line 209 of file DDAClient.cpp.

210{
211
212 for(PAGNodeSet::const_iterator lit = loadSrcNodes.begin(); lit!=loadSrcNodes.end(); lit++)
213 {
214 for(PAGNodeSet::const_iterator sit = storeDstNodes.begin(); sit!=storeDstNodes.end(); sit++)
215 {
216 const PAGNode* node1 = *lit;
217 const PAGNode* node2 = *sit;
218 AliasResult result = pta->alias(node1->getId(), node2->getId());
219 outs() << "\n=================================================\n";
220 outs() << "Alias Query for (" << node1->valueOnlyToString() << ",";
221 outs() << node2->valueOnlyToString() << ") \n";
222 outs() << "[NodeID:" << node1->getId() << ", NodeID:" << node2->getId() << " " << result << "]\n";
223 outs() << "=================================================\n";
224 }
225 }
226}
virtual AliasResult alias(const SVFVar *V1, const SVFVar *V2)=0
Interface exposed to users of our pointer analysis, given Value infos.
const std::string valueOnlyToString() const
Definition LLVMUtil.cpp:747
std::ostream & outs()
Overwrite llvm::outs().
Definition SVFUtil.h:58
AliasResult
Definition SVFType.h:619

Member Data Documentation

◆ gepSrcNodes

PAGNodeSet SVF::AliasDDAClient::gepSrcNodes
private

Definition at line 158 of file DDAClient.h.

◆ loadSrcNodes

PAGNodeSet SVF::AliasDDAClient::loadSrcNodes
private

Definition at line 156 of file DDAClient.h.

◆ storeDstNodes

PAGNodeSet SVF::AliasDDAClient::storeDstNodes
private

Definition at line 157 of file DDAClient.h.

◆ vtableToCallSiteMap

VTablePtrToCallSiteMap SVF::AliasDDAClient::vtableToCallSiteMap
private

Definition at line 155 of file DDAClient.h.


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