Static Value-Flow Analysis
dda.cpp
Go to the documentation of this file.
1 //===- dda.cpp --On Demand Value Flow Analysis---------------------------//
2 //
3 // SVF: Static Value-Flow Analysis
4 //
5 // Copyright (C) <2013-2022> <Yulei Sui>
6 //
7 
8 // This program is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Affero General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12 
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU Affero General Public License for more details.
17 
18 // You should have received a copy of the GNU Affero General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 //
21 //===----------------------------------------------------------------------===//
22 
23 /*
24  // On Demand Value Flow Analysis
25  //
26  // Author: Yulei Sui,
27  */
28 
29 //#include "AliasUtil/AliasAnalysisCounter.h"
30 //#include "MemoryModel/ComTypeModel.h"
31 #include "SVF-LLVM/LLVMUtil.h"
32 #include "SVF-LLVM/SVFIRBuilder.h"
33 #include "DDA/DDAPass.h"
34 #include "Util/Options.h"
35 
36 using namespace llvm;
37 using namespace SVF;
38 
39 //static cl::list<const PassInfo*, bool, PassNameParser>
40 //PassList(cl::desc("Optimizations available:"));
41 
43  "daa",
44  "Demand-Driven Alias Analysis Pass",
45  false
46 );
47 
48 int main(int argc, char ** argv)
49 {
50  std::vector<std::string> moduleNameVec;
51  moduleNameVec = OptionBase::parseOptions(
52  argc, argv, "Demand-Driven Points-to Analysis", "[options] <input-bitcode...>"
53  );
54 
55  if (Options::WriteAnder() == "ir_annotator")
56  {
57  LLVMModuleSet::preProcessBCs(moduleNameVec);
58  }
59 
60  SVFModule* svfModule = LLVMModuleSet::buildSVFModule(moduleNameVec);
61  SVFIRBuilder builder(svfModule);
62  SVFIR* pag = builder.build();
63 
64  DDAPass dda;
65  dda.runOnModule(pag);
66 
67  LLVMModuleSet::releaseLLVMModuleSet();
68  return 0;
69 
70 }
71 
static std::vector< std::string > parseOptions(int argc, char *argv[], std::string description, std::string callFormat)
Definition: CommandLine.h:75
virtual void runOnModule(SVFIR *module)
We start from here.
Definition: DDAPass.cpp:55
virtual SVFIR * build()
Start building SVFIR here.
int main(int argc, char **argv)
Definition: dda.cpp:48
static Option< bool > DAA("daa", "Demand-Driven Alias Analysis Pass", false)
for isBitcode
Definition: BasicTypes.h:68