Static Value-Flow Analysis
Loading...
Searching...
No Matches
FSMPTA.h
Go to the documentation of this file.
1//===- FSMPTA.h -- Flow-sensitive multithreaded pointer analysis (FSAM) -===//
2//
3// SVF: Static Value-Flow Analysis
4//
5// Copyright (C) <2013-> <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 * FSMPTA.h
25 *
26 * Author: Jiawei Yang
27 *
28 * Sparse flow-sensitive pointer analysis for multithreaded programs (FSAM,
29 * Sui/Di/Xue CGO'16). It runs the sparse flow-sensitive solver
30 * (`FlowSensitive`) over a *thread-aware* SVFG built by `MTASVFGBuilder`,
31 * i.e. the stock thread-oblivious value flow augmented with inter-thread
32 * (interference) edges derived from the MHP and lock analyses.
33 */
34
35#ifndef INCLUDE_MTA_FSMPTA_H_
36#define INCLUDE_MTA_FSMPTA_H_
37
38#include "WPA/FlowSensitive.h"
39#include "MTA/MHP.h"
40#include "MTA/LockAnalysis.h"
41#include "MTA/MTASVFGBuilder.h"
42#include "MTA/MTASlicer.h"
43#include <unordered_set>
44
45namespace SVF
46{
47
53template<class SVFGGraph>
54class FSMPTA : public FlowSensitive
55{
56public:
63 : FlowSensitive(m->getTCT()->getPTA()->getPAG()),
65 {
66 }
67
68 ~FSMPTA() override = default;
69
71 void initialize() override;
72
74 void processNode(NodeID nodeId) override;
75
76 inline MHP* getMHP() const
77 {
78 return mhp;
79 }
80
81private:
87};
88
89} // End namespace SVF
90
91#endif /* INCLUDE_MTA_FSMPTA_H_ */
MHP * mhp
Definition FSMPTA.h:82
MTASVFGBuilder mtaSVFGBuilder
Owns the thread-aware SVFG used by the FS solver (must outlive svfg).
Definition FSMPTA.h:84
void processNode(NodeID nodeId) override
Restrict the solve to the graph's nodes (whole: no restriction).
Definition FSMPTA.cpp:52
FSMPTA(MHP *m, LockAnalysis *la, SVFGGraph graph)
Definition FSMPTA.h:62
~FSMPTA() override=default
void initialize() override
Initialise: build the thread-aware SVFG, then solve sparsely on it.
Definition FSMPTA.cpp:76
SVFGGraph graph
The graph the solve is restricted to (see the constructor).
Definition FSMPTA.h:86
MHP * getMHP() const
Definition FSMPTA.h:76
Definition MHP.h:57
SVFIR * getPAG() const
for isBitcode
Definition BasicTypes.h:70
u32_t NodeID
Definition GeneralType.h:76
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76