Static Value-Flow Analysis
Loading...
Searching...
No Matches
MemPartition.h
Go to the documentation of this file.
1//===- MemPartition.h -- Memory region partition-----------------------------//
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 * @file: DisnctMRGenerator.h
25 * @author: yesen
26 * @date: 07/12/2013
27 * @version: 1.0
28 *
29 * @section LICENSE
30 *
31 * @section DESCRIPTION
32 *
33 */
34
35
36#ifndef DISNCTMRGENERATOR_H_
37#define DISNCTMRGENERATOR_H_
38
39#include "MSSA/MemRegion.h"
40
41namespace SVF
42{
43
48{
49public:
52
54
55protected:
57 virtual void partitionMRs();
58
60 virtual void getMRsForLoad(MRSet& aliasMRs, const NodeBS& cpts, const SVFFunction* fun);
61
63 virtual void getMRsForCallSiteRef(MRSet& aliasMRs, const NodeBS& cpts, const SVFFunction* fun);
64private:
66 void createDistinctMR(const SVFFunction* func, const NodeBS& cpts);
67
68};
69
74{
75public:
79
82
84
85protected:
86
88 virtual void partitionMRs();
89
96 virtual inline void getMRsForLoad(MRSet& aliasMRs, const NodeBS& cpts,
97 const SVFFunction* fun)
98 {
99 const PointsToList& inters = getIntersList(fun);
101 }
102
103 void getMRsForLoadFromInterList(MRSet& mrs, const NodeBS& cpts, const PointsToList& inters);
104
106 virtual void getMRsForCallSiteRef(MRSet& aliasMRs, const NodeBS& cpts, const SVFFunction* fun);
107
109 void createDisjointMR(const SVFFunction* func, const NodeBS& cpts);
110
112 void computeIntersections(const NodeBS& cpts, PointsToList& inters);
113
114private:
116 {
117 return funcToPtsMap[func];
118 }
119
121 {
122 return funcToInterMap[func];
123 }
124
125 inline const PtsToSubPtsMap& getPtsSubSetMap(const SVFFunction* func) const
126 {
127 FunToPtsMap::const_iterator it = funcToPtsMap.find(func);
128 assert(it != funcToPtsMap.end() && "can not find pts map for specified function");
129 return it->second;
130 }
131
134};
135
140{
141public:
144
146
147protected:
149 virtual void partitionMRs();
150
157 virtual inline void getMRsForLoad(MRSet& aliasMRs, const NodeBS& cpts,
158 const SVFFunction*)
159 {
161 }
162
163private:
165};
166
167} // End namespace SVF
168
169#endif /* DISNCTMRGENERATOR_H_ */
cJSON * p
Definition cJSON.cpp:2559
virtual void getMRsForLoad(MRSet &aliasMRs, const NodeBS &cpts, const SVFFunction *fun)
Get memory region at a load.
virtual void partitionMRs()
Partition regions.
virtual void getMRsForCallSiteRef(MRSet &aliasMRs, const NodeBS &cpts, const SVFFunction *fun)
Get memory regions to be inserted at a load statement.
void createDistinctMR(const SVFFunction *func, const NodeBS &cpts)
Create memory regions for each points-to target.
DistinctMRG(BVDataPTAImpl *p, bool ptrOnly)
virtual void partitionMRs()
Partition regions.
InterDisjointMRG(BVDataPTAImpl *p, bool ptrOnly)
virtual void getMRsForLoad(MRSet &aliasMRs, const NodeBS &cpts, const SVFFunction *)
const PtsToSubPtsMap & getPtsSubSetMap(const SVFFunction *func) const
void createDisjointMR(const SVFFunction *func, const NodeBS &cpts)
Create disjoint memory region.
OrderedMap< NodeBS, PointsToList > PtsToSubPtsMap
virtual void partitionMRs()
Partition regions.
Map< const SVFFunction *, PtsToSubPtsMap > FunToPtsMap
virtual void getMRsForCallSiteRef(MRSet &aliasMRs, const NodeBS &cpts, const SVFFunction *fun)
Get memory regions to be inserted at a load statement.
void getMRsForLoadFromInterList(MRSet &mrs, const NodeBS &cpts, const PointsToList &inters)
PtsToSubPtsMap & getPtsSubSetMap(const SVFFunction *func)
FunToInterMap funcToInterMap
Map< const SVFFunction *, PointsToList > FunToInterMap
void computeIntersections(const NodeBS &cpts, PointsToList &inters)
Compute intersections between cpts and computed cpts intersections before.
IntraDisjointMRG(BVDataPTAImpl *p, bool ptrOnly)
virtual void getMRsForLoad(MRSet &aliasMRs, const NodeBS &cpts, const SVFFunction *fun)
PointsToList & getIntersList(const SVFFunction *func)
OrderedSet< NodeBS, SVFUtil::equalNodeBS > PointsToList
Definition MemRegion.h:143
OrderedSet< const MemRegion *, MemRegion::equalMemRegion > MRSet
Get typedef from Pointer Analysis.
Definition MemRegion.h:141
for isBitcode
Definition BasicTypes.h:68
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74