Static Value-Flow Analysis
Loading...
Searching...
No Matches
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"
25#include "MTA/MTA.h"
26#include "Util/CommandLine.h"
27#include "Util/Options.h"
28
29#include <string>
30#include <vector>
31
32using namespace llvm;
33using namespace std;
34using namespace SVF;
35
36int main(int argc, char** argv)
37{
38 std::vector<std::string> moduleNameVec = OptionBase::parseOptions(
39 argc, argv, "MTA Analysis", "[options] <input-bitcode...>");
40
43 SVFIR* pag = builder.build();
44
45 // MTA's only client is race detection. -mta-flow-sensitive (default) selects the
46 // FSAM pipeline (SlicedMTA), which decides slicing and the pre-analysis
47 // context handling internally; otherwise run the flow-insensitive Andersen
48 // detector.
50 {
51 // The only LLVM-dependent step -- materialising resolved indirect calls
52 // into the PAG -- is injected here.
55 {
56 builder.updateCallGraph(cg);
57 });
58 }
59 else
60 {
61 MTA mta;
62 mta.runOnModule(pag);
63 }
64
66 return 0;
67}
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:140
static void buildSVFModule(Module &mod)
Definition MTA.h:86
virtual bool runOnModule(SVFIR *module)
We start the pass here.
Definition MTA.cpp:75
static const Option< bool > MTFlowSensitive
MTA: flow-sensitive (FSAM) main analysis; false = Andersen flow-insensitive base, Default: true.
Definition Options.h:256
void runOnModule(SVFIR *pag, const ResolveIndirectCalls &resolveIndirectCalls)
Run the slicing pipeline on a pre-built SVFIR.
Definition MTA.cpp:998
int main(int argc, char **argv)
Definition mta.cpp:36
for isBitcode
Definition BasicTypes.h:70
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76