Static Value-Flow Analysis
Loading...
Searching...
No Matches
Functions
cfl.cpp File Reference
#include "SVF-LLVM/LLVMUtil.h"
#include "SVF-LLVM/SVFIRBuilder.h"
#include "CFL/CFLAlias.h"
#include "CFL/CFLVF.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 
)

Definition at line 42 of file cfl.cpp.

43{
44 // Parses command-line arguments and stores any module names in moduleNameVec
45 std::vector<std::string> moduleNameVec;
47 argc, argv, "CFL Reachability Analysis", "[options] <input-bitcode...>"
48 );
49
50 // Pointer to the SVF Intermediate Representation (IR) of the module
51 SVFIR* svfir = nullptr;
52
53 // If no CFLGraph option is specified, the SVFIR is built from the .bc (bytecode) files of the modules
54 if (Options::CFLGraph().empty())
55 {
58 svfir = builder.build();
59 } // if no dot form CFLGraph is specified, we use svfir from .bc.
60
61 // The CFLBase pointer that will be used to run the analysis
62 std::unique_ptr<CFLBase> cfl;
63
64 // Determines which type of analysis to run based on the options and sets up cfl accordingly
65 if (Options::CFLSVFG())
66 cfl = std::make_unique<CFLVF>(svfir);
67 else if (Options::POCRHybrid())
68 cfl = std::make_unique<POCRHybrid>(svfir);
69 else if (Options::POCRAlias())
70 cfl = std::make_unique<POCRAlias>(svfir);
71 else
72 cfl = std::make_unique<CFLAlias>(svfir); // if no svfg is specified, we use CFLAlias as the default one.
73
74 // Runs the analysis
75 cfl->analyze();
76
77 // Releases the SVFIR and the LLVMModuleSet to free memory
80
81
82 return 0;
83
84}
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:138
static void buildSVFModule(Module &mod)
static const Option< bool > POCRAlias
Definition Options.h:234
static const Option< bool > POCRHybrid
Definition Options.h:235
static const Option< bool > CFLSVFG
Definition Options.h:233
static const Option< std::string > CFLGraph
Definition Options.h:229
static void releaseSVFIR()
Definition SVFIR.h:122
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74