Static Value-Flow Analysis
Classes | Functions | Variables
ae.cpp File Reference
#include "SVF-LLVM/SVFIRBuilder.h"
#include "WPA/WPAPass.h"
#include "Util/CommandLine.h"
#include "Util/Options.h"
#include "WPA/Andersen.h"
#include "AE/Core/RelExeState.h"
#include "AE/Core/RelationSolver.h"
#include "AE/Svfexe/AbstractInterpretation.h"

Go to the source code of this file.

Classes

class  SymblicAbstractionTest
 
class  AETest
 

Functions

int main (int argc, char **argv)
 

Variables

static Option< bool > SYMABS ("symabs", "symbolic abstraction test", false)
 
static Option< bool > AETEST ("aetest", "abstract execution basic function test", false)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 843 of file ae.cpp.

844 {
845  int arg_num = 0;
846  int extraArgc = 3;
847  char **arg_value = new char *[argc + extraArgc];
848  for (; arg_num < argc; ++arg_num)
849  {
850  arg_value[arg_num] = argv[arg_num];
851  }
852  // add extra options
853  arg_value[arg_num++] = (char*) "-model-consts=true";
854  arg_value[arg_num++] = (char*) "-model-arrays=true";
855  arg_value[arg_num++] = (char*) "-pre-field-sensitive=false";
856  assert(arg_num == (argc + extraArgc) && "more extra arguments? Change the value of extraArgc");
857 
858  std::vector<std::string> moduleNameVec;
859  moduleNameVec = OptionBase::parseOptions(
860  arg_num, arg_value, "Static Symbolic Execution", "[options] <input-bitcode...>"
861  );
862  delete[] arg_value;
863  if (SYMABS())
864  {
865  SymblicAbstractionTest saTest;
866  saTest.testsValidation();
867  return 0;
868  }
869 
870  if (AETEST())
871  {
872  AETest aeTest;
873  aeTest.testBinaryOpStmt();
874  aeTest.testAbsState();
875  return 0;
876  }
877 
878  SVFModule *svfModule = LLVMModuleSet::getLLVMModuleSet()->buildSVFModule(moduleNameVec);
879  SVFIRBuilder builder(svfModule);
880  SVFIR* pag = builder.build();
881  AndersenWaveDiff* ander = AndersenWaveDiff::createAndersenWaveDiff(pag);
882  PTACallGraph* callgraph = ander->getCallGraph();
883  builder.updateCallGraph(callgraph);
884  pag->getICFG()->updateCallGraph(callgraph);
885  AbstractInterpretation& ae = AbstractInterpretation::getAEInstance();
886  if (Options::BufferOverflowCheck())
887  ae.addDetector(std::make_unique<BufOverflowDetector>());
888  ae.runOnModule(pag->getICFG());
889 
890  LLVMModuleSet::releaseLLVMModuleSet();
891 
892  return 0;
893 }
static Option< bool > AETEST("aetest", "abstract execution basic function test", false)
static Option< bool > SYMABS("symabs", "symbolic abstraction test", false)
Definition: ae.cpp:626
void testBinaryOpStmt()
Definition: ae.cpp:632
void testAbsState()
Definition: ae.cpp:828
static std::vector< std::string > parseOptions(int argc, char *argv[], std::string description, std::string callFormat)
Definition: CommandLine.h:75
AbstractInterpretation is same as Abstract Execution.
void addDetector(std::unique_ptr< AEDetector > detector)
virtual void runOnModule(ICFG *icfg)
void updateCallGraph(PTACallGraph *callgraph)
update ICFG for indirect calls
Definition: ICFG.cpp:419
PTACallGraph * getCallGraph() const
Return call graph.
ICFG * getICFG() const
Definition: SVFIR.h:171
void testsValidation()
Definition: ae.cpp:603

Variable Documentation

◆ AETEST

Option<bool> AETEST("aetest", "abstract execution basic function test", false) ( "aetest"  ,
"abstract execution basic function test"  ,
false   
)
static

◆ SYMABS

Option<bool> SYMABS("symabs", "symbolic abstraction test", false) ( "symabs"  ,
"symbolic abstraction test"  ,
false   
)
static