Static Value-Flow Analysis
mta.cpp
Go to the documentation of this file.
1 //===- mta.cpp --Program Analysis for Multithreaded Programs------------------//
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 #include "SVF-LLVM/LLVMUtil.h"
24 #include "SVF-LLVM/SVFIRBuilder.h"
25 #include "MTA/MTA.h"
26 #include "Util/CommandLine.h"
27 #include "Util/Options.h"
28 
29 using namespace llvm;
30 using namespace std;
31 using namespace SVF;
32 
33 int main(int argc, char ** argv)
34 {
35 
36  std::vector<std::string> moduleNameVec;
37  moduleNameVec = OptionBase::parseOptions(
38  argc, argv, "MTA Analysis", "[options] <input-bitcode...>"
39  );
40 
41  if (Options::WriteAnder() == "ir_annotator")
42  {
43  LLVMModuleSet::preProcessBCs(moduleNameVec);
44  }
45 
46  SVFModule* svfModule = LLVMModuleSet::buildSVFModule(moduleNameVec);
47  SVFIRBuilder builder(svfModule);
48  SVFIR* pag = builder.build();
49 
50 
51  MTA mta;
52  mta.runOnModule(pag);
53 
54  LLVMModuleSet::releaseLLVMModuleSet();
55 
56 
57  return 0;
58 }
static std::vector< std::string > parseOptions(int argc, char *argv[], std::string description, std::string callFormat)
Definition: CommandLine.h:75
Definition: MTA.h:57
virtual bool runOnModule(SVFIR *module)
We start the pass here.
Definition: MTA.cpp:61
virtual SVFIR * build()
Start building SVFIR here.
int main(int argc, char **argv)
Definition: mta.cpp:33
for isBitcode
Definition: BasicTypes.h:68