Static Value-Flow Analysis
Loading...
Searching...
No Matches
saber.cpp File Reference

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 42 of file saber.cpp.

43{
44
45 std::vector<std::string> moduleNameVec;
46 moduleNameVec = OptionBase::parseOptions(
47 argc, argv, "Source-Sink Bug Detector", "[options] <input-bitcode...>"
48 );
49
50 LLVMModuleSet::buildSVFModule(moduleNameVec);
51 SVFIRBuilder builder;
52 SVFIR* pag = builder.build();
53
54
55 std::unique_ptr<LeakChecker> saber;
56
58 saber = std::make_unique<LeakChecker>();
59 else if(Options::FileCheck())
60 saber = std::make_unique<FileChecker>();
61 else if(Options::DFreeCheck())
62 saber = std::make_unique<DoubleFreeChecker>();
63 else
64 saber = std::make_unique<LeakChecker>(); // if no checker is specified, we use leak checker as the default one.
65
66 saber->runOnModule(pag);
68
69
70 return 0;
71
72}
static std::vector< std::string > parseOptions(int argc, char *argv[], std::string description, std::string callFormat)
Definition CommandLine.h:75
static void releaseLLVMModuleSet()
Definition LLVMModule.h:144
static void buildSVFModule(Module &mod)
static const Option< bool > DFreeCheck
double free checker, Default: false
Definition Options.h:256
static const Option< bool > FileCheck
file open close checker, Default: false
Definition Options.h:254
static const Option< bool > MemoryLeakCheck
memory leak check, Default: false
Definition Options.h:252
virtual SVFIR * build()
Start building SVFIR here.