Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVFLoop.h
Go to the documentation of this file.
1//===- SVFLoop.h -- SVFLoop of SVF ------------------------------//
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 * SVFLoop.h
25 *
26 * Created on: 14, 06, 2022
27 * Author: Jiawei Wang, Xiao Cheng
28 */
29
30#ifndef SVF_SVFLOOP_H
31#define SVF_SVFLOOP_H
32
33#include "SVFIR/SVFType.h"
34
35namespace SVF
36{
37
39{
40
43private:
47
48public:
54
55 virtual ~SVFLoop() = default;
56
57 inline ICFGNodeSet::iterator ICFGNodesBegin()
58 {
59 return icfgNodes.begin();
60 }
61
62 inline ICFGNodeSet::iterator ICFGNodesEnd()
63 {
64 return icfgNodes.end();
65 }
66
67 inline bool isInLoop(const ICFGNode *icfgNode) const
68 {
69 return icfgNodes.find(icfgNode) != icfgNodes.end();
70 }
71
72 inline bool isEntryICFGEdge(const ICFGEdge *edge) const
73 {
74 return entryICFGEdges.find(edge) != entryICFGEdges.end();
75 }
76
77 inline bool isBackICFGEdge(const ICFGEdge *edge) const
78 {
79 return backICFGEdges.find(edge) != backICFGEdges.end();
80 }
81
82 inline bool isInICFGEdge(const ICFGEdge *edge) const
83 {
84 return inICFGEdges.find(edge) != inICFGEdges.end();
85 }
86
87 inline bool isOutICFGEdge(const ICFGEdge *edge) const
88 {
89 return outICFGEdges.find(edge) != outICFGEdges.end();
90 }
91
92 inline void addEntryICFGEdge(const ICFGEdge *edge)
93 {
94 entryICFGEdges.insert(edge);
95 }
96
97 inline ICFGEdgeSet::iterator entryICFGEdgesBegin()
98 {
99 return entryICFGEdges.begin();
100 }
101
102 inline ICFGEdgeSet::iterator entryICFGEdgesEnd()
103 {
104 return entryICFGEdges.end();
105 }
106
107 inline void addOutICFGEdge(const ICFGEdge *edge)
108 {
109 outICFGEdges.insert(edge);
110 }
111
112 inline ICFGEdgeSet::iterator outICFGEdgesBegin()
113 {
114 return outICFGEdges.begin();
115 }
116
117 inline ICFGEdgeSet::iterator outICFGEdgesEnd()
118 {
119 return outICFGEdges.end();
120 }
121
122 inline void addBackICFGEdge(const ICFGEdge *edge)
123 {
124 backICFGEdges.insert(edge);
125 }
126
127 inline ICFGEdgeSet::iterator backICFGEdgesBegin()
128 {
129 return backICFGEdges.begin();
130 }
131
132 inline ICFGEdgeSet::iterator backICFGEdgesEnd()
133 {
134 return backICFGEdges.end();
135 }
136
137 inline void addInICFGEdge(const ICFGEdge *edge)
138 {
139 inICFGEdges.insert(edge);
140 }
141
142 inline ICFGEdgeSet::iterator inEdgesBegin()
143 {
144 return inICFGEdges.begin();
145 }
146
147 inline ICFGEdgeSet::iterator inEdgesEnd()
148 {
149 return inICFGEdges.end();
150 }
151
153 {
155 }
156
157 inline u32_t getLoopBound() const
158 {
159 return loopBound;
160 }
161};
162
163} // End namespace SVF
164
165#endif //SVF_SVFLOOP_H
void addBackICFGEdge(const ICFGEdge *edge)
Definition SVFLoop.h:122
ICFGNodeSet icfgNodes
Definition SVFLoop.h:45
SVFLoop(const ICFGNodeSet &_nodes, u32_t _bound)
Definition SVFLoop.h:49
virtual ~SVFLoop()=default
ICFGNodeSet::iterator ICFGNodesBegin()
Definition SVFLoop.h:57
bool isEntryICFGEdge(const ICFGEdge *edge) const
Definition SVFLoop.h:72
Set< const ICFGNode * > ICFGNodeSet
Definition SVFLoop.h:42
ICFGNodeSet::iterator ICFGNodesEnd()
Definition SVFLoop.h:62
void addOutICFGEdge(const ICFGEdge *edge)
Definition SVFLoop.h:107
bool isOutICFGEdge(const ICFGEdge *edge) const
Definition SVFLoop.h:87
ICFGEdgeSet entryICFGEdges
Definition SVFLoop.h:44
ICFGEdgeSet::iterator outICFGEdgesBegin()
Definition SVFLoop.h:112
ICFGEdgeSet::iterator backICFGEdgesEnd()
Definition SVFLoop.h:132
bool isBackICFGEdge(const ICFGEdge *edge) const
Definition SVFLoop.h:77
ICFGEdgeSet::iterator outICFGEdgesEnd()
Definition SVFLoop.h:117
void addEntryICFGEdge(const ICFGEdge *edge)
Definition SVFLoop.h:92
ICFGEdgeSet inICFGEdges
Definition SVFLoop.h:44
ICFGEdgeSet::iterator backICFGEdgesBegin()
Definition SVFLoop.h:127
ICFGEdgeSet::iterator entryICFGEdgesEnd()
Definition SVFLoop.h:102
u32_t loopBound
Definition SVFLoop.h:46
ICFGEdgeSet outICFGEdges
Definition SVFLoop.h:44
ICFGEdgeSet::iterator inEdgesBegin()
Definition SVFLoop.h:142
void addInICFGEdge(const ICFGEdge *edge)
Definition SVFLoop.h:137
ICFGEdgeSet::iterator inEdgesEnd()
Definition SVFLoop.h:147
u32_t getLoopBound() const
Definition SVFLoop.h:157
ICFGEdgeSet::iterator entryICFGEdgesBegin()
Definition SVFLoop.h:97
bool isInICFGEdge(const ICFGEdge *edge) const
Definition SVFLoop.h:82
ICFGEdgeSet backICFGEdges
Definition SVFLoop.h:44
Set< const ICFGEdge * > ICFGEdgeSet
Definition SVFLoop.h:41
bool isInLoop(const ICFGNode *icfgNode) const
Definition SVFLoop.h:67
void setLoopBound(u32_t _bound)
Definition SVFLoop.h:152
for isBitcode
Definition BasicTypes.h:68
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74
unsigned u32_t
Definition GeneralType.h:47