37#include <llvm/Support/ManagedStatic.h>
58 raw_string_ostream rawstr(str);
65 rawstr <<
" " << *ii <<
" ";
67 rawstr <<
"(" << targetObj->
toString() <<
")\t ";
83 while (!worklist.
empty())
91 if (visited.find(succNode) == visited.end())
93 visited.insert(succNode);
94 worklist.
push(succNode);
114 worklist.
push(vNode);
117 while (!worklist.
empty())
125 if (visited.find(succNode) == visited.end())
127 visited.insert(succNode);
128 worklist.
push(succNode);
144int main(
int argc,
char ** argv)
147 std::vector<std::string> moduleNameVec;
149 argc, argv,
"Whole Program Points-to Analysis",
"[options] <input-bitcode...>"
170 VFG* vfg =
new VFG(callgraph);
179 for (
const auto& it : *svfg)
192 const SVFGNode* node2 = edge->getDstNode();
203 for (
const auto& it : *icfg)
217#if LLVM_VERSION_MAJOR < 21
218 llvm::llvm_shutdown();
static std::vector< std::string > parseOptions(int argc, char *argv[], std::string description, std::string callFormat)
static AndersenWaveDiff * createAndersenWaveDiff(SVFIR *_pag)
Create an singleton instance directly instead of invoking llvm pass manager.
static void releaseAndersenWaveDiff()
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
static LLVMModuleSet * getLLVMModuleSet()
static void releaseLLVMModuleSet()
static void preProcessBCs(std::vector< std::string > &moduleNameVec)
static void buildSVFModule(Module &mod)
void dumpModulesToFile(const std::string &suffix)
static const Option< bool > PTSPrint
virtual const PointsTo & getPts(NodeID ptr)=0
Get points-to targets of a pointer. It needs to be implemented in child class.
CallGraph * getCallGraph() const
Return call graph.
virtual AliasResult alias(const SVFVar *V1, const SVFVar *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)
bool hasDefSVFGNode(const ValVar *valVar) const
Given a valVar, return whether it has definition site.
const SVFGNode * getDefSVFGNode(const ValVar *valVar) const
Given a valVar, return its definition site.
virtual SVFIR * build()
Start building SVFIR here.
static void releaseSVFIR()
NodeID getId() const
Get ID.
virtual const std::string toString() const
Get string representation.
virtual const SVFVar * getValue() const
Return the corresponding LLVM value, if possible, nullptr otherwise.
VFGEdge::VFGEdgeSetTy::const_iterator const_iterator
LLVM_NODISCARD std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > dyn_cast(const Y &Val)
std::unordered_set< Key, Hash, KeyEqual, Allocator > Set
void traverseOnICFG(ICFG *icfg, const ICFGNode *iNode)
int main(int argc, char **argv)
std::string printPts(PointerAnalysis *pta, const SVFVar *svfval)
SVF::AliasResult aliasQuery(PointerAnalysis *pta, const SVFVar *v1, const SVFVar *v2)
void dummyVisit(const VFGNode *node)
void traverseOnVFG(const SVFG *vfg, const ValVar *svfval)