35#ifndef INCLUDE_WPA_ANDERSEN_H_
36#define INCLUDE_WPA_ANDERSEN_H_
75 virtual void analyze()
override;
384 return "AndersenWPA";
389 virtual void cluster(
void)
const;
static bool classof(const PointerAnalysis *pta)
static double timeOfSCCMerges
static u32_t numOfProcessedCopy
Number of processed Addr edge.
NodeBS & sccSubNodes(NodeID repId)
static u32_t numOfSCCDetection
virtual void normalizePointsTo() override
static u32_t numOfSfrs
Number of processed Store edge.
virtual void finalize() override
Finalize analysis.
static double timeOfUpdateCallGraph
static u32_t numOfProcessedStore
Number of processed Load edge.
virtual void connectCaller2CalleeParams(const CallICFGNode *cs, const SVFFunction *F, NodePairSet &cpySrcNodes)
Connect formal and actual parameters for indirect callsites.
static u32_t numOfProcessedAddr
Statistics.
virtual bool updateCallGraph(const CallSiteToFunPtrMap &) override
Update call graph.
void printStat()
dump statistics
void heapAllocatorViaIndCall(const CallICFGNode *cs, NodePairSet &cpySrcNodes)
CallSite2DummyValPN callsite2DummyValPN
virtual void readPtsFromFile(const std::string &filename)
static u32_t numOfProcessedLoad
Number of processed Gep edge.
static double timeOfSCCDetection
virtual bool addCopyEdge(NodeID src, NodeID dst)=0
Add copy edge on constraint graph.
virtual void initialize() override
Initialize analysis.
ConstraintGraph * getConstraintGraph()
Get constraint graph.
~AndersenBase() override
Destructor.
virtual void analyze() override
Andersen analysis.
static u32_t numOfFieldExpand
static double timeOfProcessLoadStore
static u32_t numOfProcessedGep
Number of processed Copy edge.
static double timeOfProcessCopyGep
OrderedMap< const CallICFGNode *, NodeID > CallSite2DummyValPN
static u32_t MaxPointsToSetSize
virtual void solveConstraints()
virtual bool updateThreadCallGraph(const CallSiteToFunPtrMap &, NodePairSet &)
Update thread call graph.
static double timeOfCollapse
static u32_t AveragePointsToSetSize
virtual void solveAndwritePtsToFile(const std::string &filename)
ConstraintGraph * consCG
Constraint Graph.
void cleanConsCG(NodeID id)
remove redundant gepnodes in constraint graph
AndersenBase(SVFIR *_pag, PTATY type=Andersen_BASE, bool alias_check=true)
Constructor.
static bool classof(const AndersenBase *)
Methods for support type inquiry through isa, cast, and dyn_cast:
virtual void connectCaller2ForkedFunParams(const CallICFGNode *cs, const SVFFunction *F, NodePairSet &cpySrcNodes)
Connect formal and actual parameters for indirect forksites.
NodeID sccRepNode(NodeID id) const override
SCC methods.
static AndersenWaveDiff * createAndersenWaveDiff(SVFIR *_pag)
Create an singleton instance directly instead of invoking llvm pass manager.
virtual void solveWorklist()
virtual void initialize()
static void releaseAndersenWaveDiff()
AndersenWaveDiff(SVFIR *_pag, PTATY type=AndersenWaveDiff_WPA, bool alias_check=true)
virtual bool handleStore(NodeID id, const ConstraintEdge *store)
virtual bool handleLoad(NodeID id, const ConstraintEdge *load)
virtual void postProcessNode(NodeID nodeId)
static AndersenWaveDiff * diffWave
virtual void processNode(NodeID nodeId)
virtual void handleLoadStore(ConstraintNode *node)
void setDetectPWC(bool flag)
virtual ~Andersen()
Destructor.
void mergeSccNodes(NodeID repNodeId, const NodeBS &subNodes)
Merge sub node in a SCC cycle to their rep node.
virtual void processNode(NodeID nodeId)
Override WPASolver function in order to use the default solver.
virtual void initialize()
Initialize analysis.
CallSite2DummyValPN callsite2DummyValPN
Map an instruction to a dummy obj which created at an indirect callsite, which invokes a heap allocat...
void sanitizePts()
Sanitize pts for field insensitive objects.
virtual NodeStack & SCCDetect()
SCC detection.
virtual void mergeNodeToRep(NodeID nodeId, NodeID newRepId)
Merge sub node to its rep.
bool collapseNodePts(NodeID nodeId)
void updatePropaPts(NodeID dstId, NodeID srcId)
Handle propagated points-to set.
static bool classof(const PointerAnalysis *pta)
Andersen(SVFIR *_pag, PTATY type=Andersen_WPA, bool alias_check=true)
Constructor.
SCCDetection< ConstraintGraph * > CGSCC
virtual void computeDiffPts(NodeID id)
Handle diff points-to set.
void clearPropaPts(NodeID src)
virtual bool addCopyEdge(NodeID src, NodeID dst)
Add copy edge on constraint graph.
virtual bool unionPts(NodeID id, NodeID ptd)
virtual void initWorklist()
void resetData()
Reset data.
virtual const PointsTo & getDiffPts(NodeID id)
virtual bool processGep(NodeID node, const GepCGEdge *edge)
static bool classof(const Andersen *)
Methods for support type inquiry through isa, cast, and dyn_cast:
virtual void handleCopyGep(ConstraintNode *node)
virtual bool unionPts(NodeID id, const PointsTo &target)
virtual bool processLoad(NodeID node, const ConstraintEdge *load)
virtual const PointsTo & getPts(NodeID id)
Operation of points-to set.
void collapseFields()
collapse positive weight cycles of a graph
virtual bool processStore(NodeID node, const ConstraintEdge *load)
virtual bool processCopy(NodeID node, const ConstraintEdge *edge)
virtual bool processGepPts(const PointsTo &pts, const GepCGEdge *edge)
virtual void processAddr(const AddrCGEdge *addr)
void updateNodeRepAndSubs(NodeID nodeId, NodeID newRepId)
Updates subnodes of its rep, and rep node of its subs.
virtual void finalize()
Finalize analysis.
virtual const std::string PTAName() const
Get PTA name.
void processAllAddr()
handling various constraints
virtual void cluster(void) const
virtual bool mergeSrcToTgt(NodeID srcId, NodeID tgtId)
virtual void collapsePWCNode(NodeID nodeId)
Collapse a field object into its base for field insensitive analysis.
bool collapseField(NodeID nodeId)
DiffPTDataTy * getDiffPTDataTy() const
PTDataTy * getPTDataTy() const
Get points-to data structure.
virtual bool addPts(NodeID id, NodeID ptd)
NodeID sccRepNode(NodeID id) const
SCC rep/sub nodes methods.
CopyCGEdge * addCopyCGEdge(NodeID src, NodeID dst)
Add Copy edge.
NodeBS & sccSubNodes(NodeID id)
NodeBS & getAllFieldsObjVars(NodeID id)
iterator begin()
Iterators.
IDToNodeMapTy::iterator iterator
Node Iterators.
static Option< bool > DetectPWC
static const Option< bool > DiffPts
PTATY
Pointer analysis type list.
@ AndersenSCD_WPA
Selective cycle detection andersen-style WPA.
@ Andersen_BASE
Base Andersen PTA.
@ Andersen_WPA
Andersen PTA.
@ AndersenWaveDiff_WPA
Diff wave propagation andersen-style WPA.
@ TypeCPP_WPA
Type-based analysis for C++.
@ AndersenSFR_WPA
Stride-based field representation.
@ Steensgaard_WPA
Steensgaard PTA.
bool isFieldInsensitive(NodeID id) const
void dumpStat()
Dump the statistics.
PTATY getAnalysisTy() const
Type of pointer analysis.
SVFIR::CallSiteToFunPtrMap CallSiteToFunPtrMap
u32_t OnTheFlyIterBudgetForStat
Flag for iteration budget for on-the-fly statistics.
u32_t iterationForPrintStat
print out statistics for i-th iteration
std::stack< NodeID > NodeStack
llvm::IRBuilder IRBuilder
Set< NodePair > NodePairSet
WPASolver< ConstraintGraph * > WPAConstraintSolver