Static Value-Flow Analysis
Functions
wpa.cpp File Reference
#include "SVF-LLVM/LLVMUtil.h"
#include "SVF-LLVM/SVFIRBuilder.h"
#include "WPA/WPAPass.h"
#include "Util/CommandLine.h"
#include "Util/Options.h"
#include "SVFIR/SVFFileSystem.h"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Build SVFIR

Definition at line 41 of file wpa.cpp.

42 {
43  auto moduleNameVec =
44  OptionBase::parseOptions(argc, argv, "Whole Program Points-to Analysis",
45  "[options] <input-bitcode...>");
46 
47  // Refers to content of a singleton unique_ptr<SVFIR> in SVFIR.
48  SVFIR* pag;
49 
50  if (Options::ReadJson())
51  {
52  pag = SVFIRReader::read(moduleNameVec.front());
53  }
54  else
55  {
56  if (Options::WriteAnder() == "ir_annotator")
57  {
58  LLVMModuleSet::preProcessBCs(moduleNameVec);
59  }
60 
61  SVFModule* svfModule = LLVMModuleSet::buildSVFModule(moduleNameVec);
62 
64  SVFIRBuilder builder(svfModule);
65  pag = builder.build();
66 
67  }
68 
69  WPAPass wpa;
70  wpa.runOnModule(pag);
71 
72  LLVMModuleSet::releaseLLVMModuleSet();
73  return 0;
74 }
static std::vector< std::string > parseOptions(int argc, char *argv[], std::string description, std::string callFormat)
Definition: CommandLine.h:75
virtual void runOnModule(SVFIR *svfModule)
Run pointer analysis on SVFModule.
Definition: WPAPass.cpp:69