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 "Util/GeneralType.h"
34
35namespace SVF
36{
37
38class ICFGEdge;
39class ICFGNode;
40
42{
43
46private:
50
51public:
57
58 virtual ~SVFLoop() = default;
59
60 inline ICFGNodeSet::iterator ICFGNodesBegin()
61 {
62 return icfgNodes.begin();
63 }
64
65 inline ICFGNodeSet::iterator ICFGNodesEnd()
66 {
67 return icfgNodes.end();
68 }
69
70 inline bool isInLoop(const ICFGNode *icfgNode) const
71 {
72 return icfgNodes.find(icfgNode) != icfgNodes.end();
73 }
74
75 inline bool isEntryICFGEdge(const ICFGEdge *edge) const
76 {
77 return entryICFGEdges.find(edge) != entryICFGEdges.end();
78 }
79
80 inline bool isBackICFGEdge(const ICFGEdge *edge) const
81 {
82 return backICFGEdges.find(edge) != backICFGEdges.end();
83 }
84
85 inline bool isInICFGEdge(const ICFGEdge *edge) const
86 {
87 return inICFGEdges.find(edge) != inICFGEdges.end();
88 }
89
90 inline bool isOutICFGEdge(const ICFGEdge *edge) const
91 {
92 return outICFGEdges.find(edge) != outICFGEdges.end();
93 }
94
95 inline void addEntryICFGEdge(const ICFGEdge *edge)
96 {
97 entryICFGEdges.insert(edge);
98 }
99
100 inline ICFGEdgeSet::iterator entryICFGEdgesBegin()
101 {
102 return entryICFGEdges.begin();
103 }
104
105 inline ICFGEdgeSet::iterator entryICFGEdgesEnd()
106 {
107 return entryICFGEdges.end();
108 }
109
110 inline void addOutICFGEdge(const ICFGEdge *edge)
111 {
112 outICFGEdges.insert(edge);
113 }
114
115 inline ICFGEdgeSet::iterator outICFGEdgesBegin()
116 {
117 return outICFGEdges.begin();
118 }
119
120 inline ICFGEdgeSet::iterator outICFGEdgesEnd()
121 {
122 return outICFGEdges.end();
123 }
124
125 inline void addBackICFGEdge(const ICFGEdge *edge)
126 {
127 backICFGEdges.insert(edge);
128 }
129
130 inline ICFGEdgeSet::iterator backICFGEdgesBegin()
131 {
132 return backICFGEdges.begin();
133 }
134
135 inline ICFGEdgeSet::iterator backICFGEdgesEnd()
136 {
137 return backICFGEdges.end();
138 }
139
140 inline void addInICFGEdge(const ICFGEdge *edge)
141 {
142 inICFGEdges.insert(edge);
143 }
144
145 inline ICFGEdgeSet::iterator inEdgesBegin()
146 {
147 return inICFGEdges.begin();
148 }
149
150 inline ICFGEdgeSet::iterator inEdgesEnd()
151 {
152 return inICFGEdges.end();
153 }
154
156 {
158 }
159
160 inline u32_t getLoopBound() const
161 {
162 return loopBound;
163 }
164};
165
166} // End namespace SVF
167
168#endif //SVF_SVFLOOP_H
void addBackICFGEdge(const ICFGEdge *edge)
Definition SVFLoop.h:125
ICFGNodeSet icfgNodes
Definition SVFLoop.h:48
SVFLoop(const ICFGNodeSet &_nodes, u32_t _bound)
Definition SVFLoop.h:52
virtual ~SVFLoop()=default
ICFGNodeSet::iterator ICFGNodesBegin()
Definition SVFLoop.h:60
bool isEntryICFGEdge(const ICFGEdge *edge) const
Definition SVFLoop.h:75
Set< const ICFGNode * > ICFGNodeSet
Definition SVFLoop.h:45
ICFGNodeSet::iterator ICFGNodesEnd()
Definition SVFLoop.h:65
void addOutICFGEdge(const ICFGEdge *edge)
Definition SVFLoop.h:110
bool isOutICFGEdge(const ICFGEdge *edge) const
Definition SVFLoop.h:90
ICFGEdgeSet entryICFGEdges
Definition SVFLoop.h:47
ICFGEdgeSet::iterator outICFGEdgesBegin()
Definition SVFLoop.h:115
ICFGEdgeSet::iterator backICFGEdgesEnd()
Definition SVFLoop.h:135
bool isBackICFGEdge(const ICFGEdge *edge) const
Definition SVFLoop.h:80
ICFGEdgeSet::iterator outICFGEdgesEnd()
Definition SVFLoop.h:120
void addEntryICFGEdge(const ICFGEdge *edge)
Definition SVFLoop.h:95
ICFGEdgeSet inICFGEdges
Definition SVFLoop.h:47
ICFGEdgeSet::iterator backICFGEdgesBegin()
Definition SVFLoop.h:130
ICFGEdgeSet::iterator entryICFGEdgesEnd()
Definition SVFLoop.h:105
u32_t loopBound
Definition SVFLoop.h:49
ICFGEdgeSet outICFGEdges
Definition SVFLoop.h:47
ICFGEdgeSet::iterator inEdgesBegin()
Definition SVFLoop.h:145
void addInICFGEdge(const ICFGEdge *edge)
Definition SVFLoop.h:140
ICFGEdgeSet::iterator inEdgesEnd()
Definition SVFLoop.h:150
u32_t getLoopBound() const
Definition SVFLoop.h:160
ICFGEdgeSet::iterator entryICFGEdgesBegin()
Definition SVFLoop.h:100
bool isInICFGEdge(const ICFGEdge *edge) const
Definition SVFLoop.h:85
ICFGEdgeSet backICFGEdges
Definition SVFLoop.h:47
Set< const ICFGEdge * > ICFGEdgeSet
Definition SVFLoop.h:44
bool isInLoop(const ICFGNode *icfgNode) const
Definition SVFLoop.h:70
void setLoopBound(u32_t _bound)
Definition SVFLoop.h:155
for isBitcode
Definition BasicTypes.h:70
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76
unsigned u32_t
Definition GeneralType.h:67