46 return pta->
alias(v1, v2);
56 raw_string_ostream rawstr(str);
63 rawstr <<
" " << *ii <<
" ";
84 while (!worklist.
empty())
92 if (visited.find(succNode) == visited.end())
94 visited.insert(succNode);
95 worklist.
push(succNode);
110 SVFIR* pag = SVFIR::getPAG();
117 worklist.
push(vNode);
120 while (!worklist.
empty())
128 if (visited.find(succNode) == visited.end())
130 visited.insert(succNode);
131 worklist.
push(succNode);
147 int main(
int argc,
char ** argv)
150 std::vector<std::string> moduleNameVec;
152 argc, argv,
"Whole Program Points-to Analysis",
"[options] <input-bitcode...>"
155 if (Options::WriteAnder() ==
"ir_annotator")
157 LLVMModuleSet::preProcessBCs(moduleNameVec);
160 SVFModule* svfModule = LLVMModuleSet::buildSVFModule(moduleNameVec);
167 Andersen* ander = AndersenWaveDiff::createAndersenWaveDiff(pag);
177 VFG* vfg =
new VFG(callgraph);
184 if (Options::PTSPrint())
186 for (
const auto& it : *svfg)
196 const SVFGNode* node2 = edge->getDstNode();
205 if (Options::PTSPrint())
207 for (
const auto& it : *icfg)
216 AndersenWaveDiff::releaseAndersenWaveDiff();
217 SVFIR::releaseSVFIR();
219 LLVMModuleSet::getLLVMModuleSet()->dumpModulesToFile(
".svf.bc");
221 llvm::llvm_shutdown();
static std::vector< std::string > parseOptions(int argc, char *argv[], std::string description, std::string callFormat)
bool push(const Data &data)
NodeType * getDstNode() const
NodeType * getGNode(NodeID id) const
Get a node.
const GEdgeSetTy & getOutEdges() const
iterator OutEdgeBegin()
iterators
ICFGEdge::ICFGEdgeSetTy::const_iterator const_iterator
NodeID getValueNode(const SVFValue *V)
static void releaseLLVMModuleSet()
virtual const PointsTo & getPts(NodeID ptr)=0
Get points-to targets of a pointer. It needs to be implemented in child class.
PTACallGraph * getCallGraph() const
Return call graph.
virtual AliasResult alias(const SVFValue *V1, const SVFValue *V2)=0
Interface exposed to users of our pointer analysis, given Value infos.
const_iterator end() const
const_iterator begin() const
SVFG * buildFullSVFG(BVDataPTAImpl *pta)
const SVFGNode * getDefSVFGNode(const PAGNode *pagNode) const
Given a pagNode, return its definition site.
bool hasDefSVFGNode(const PAGNode *pagNode) const
Given a pagNode, return whether it has definition site.
virtual SVFIR * build()
Start building SVFIR here.
std::string toString() const
Needs to be implemented by a SVF front end.
const SVFValue * getValue() const
Get/has methods of the components.
VFGEdge::VFGEdgeSetTy::const_iterator const_iterator
virtual const SVFValue * getValue() const
Return the corresponding LLVM value, if possible, nullptr otherwise.
std::unordered_set< Key, Hash, KeyEqual, Allocator > Set
void traverseOnICFG(ICFG *icfg, const ICFGNode *iNode)
std::string printPts(PointerAnalysis *pta, const SVFValue *svfval)
int main(int argc, char **argv)
void traverseOnVFG(const SVFG *vfg, const SVFValue *svfval)
void dummyVisit(const VFGNode *node)
SVF::AliasResult aliasQuery(PointerAnalysis *pta, const SVFValue *v1, const SVFValue *v2)