Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Attributes | List of all members
SVF::FIFOWorkList< Data > Class Template Reference

#include <WorkList.h>

Public Member Functions

 FIFOWorkList ()
 
 FIFOWorkList (const std::vector< Data > &vec)
 Construct from a vector, pushing all elements in order.
 
 FIFOWorkList (const std::list< Data > &lst)
 Construct from a list, pushing all elements in order.
 
 ~FIFOWorkList ()
 
bool empty () const
 
u32_t size () const
 
bool find (const Data &data) const
 
bool push (const Data &data)
 
void removeFront ()
 
Datafront ()
 
Data pop ()
 
void clear ()
 

Private Types

typedef Set< DataDataSet
 
typedef std::deque< DataDataDeque
 

Private Attributes

DataSet data_set
 store all data in the work list.
 
DataDeque data_list
 work list using std::vector.
 

Detailed Description

template<class Data>
class SVF::FIFOWorkList< Data >

Worklist with "first in first out" order. New nodes will be pushed at back and popped from front. Elements in the list are unique as they're recorded by Set.

Definition at line 138 of file WorkList.h.

Member Typedef Documentation

◆ DataDeque

template<class Data >
typedef std::deque<Data> SVF::FIFOWorkList< Data >::DataDeque
private

Definition at line 141 of file WorkList.h.

◆ DataSet

template<class Data >
typedef Set<Data> SVF::FIFOWorkList< Data >::DataSet
private

Definition at line 140 of file WorkList.h.

Constructor & Destructor Documentation

◆ FIFOWorkList() [1/3]

template<class Data >
SVF::FIFOWorkList< Data >::FIFOWorkList ( )
inline

Definition at line 143 of file WorkList.h.

143{}

◆ FIFOWorkList() [2/3]

template<class Data >
SVF::FIFOWorkList< Data >::FIFOWorkList ( const std::vector< Data > &  vec)
inlineexplicit

Construct from a vector, pushing all elements in order.

Definition at line 146 of file WorkList.h.

147 {
148 for (const Data& d : vec)
149 push(d);
150 }
bool push(const Data &data)
Definition WorkList.h:180
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

◆ FIFOWorkList() [3/3]

template<class Data >
SVF::FIFOWorkList< Data >::FIFOWorkList ( const std::list< Data > &  lst)
inlineexplicit

Construct from a list, pushing all elements in order.

Definition at line 153 of file WorkList.h.

154 {
155 for (const Data& d : lst)
156 push(d);
157 }

◆ ~FIFOWorkList()

template<class Data >
SVF::FIFOWorkList< Data >::~FIFOWorkList ( )
inline

Definition at line 159 of file WorkList.h.

159{}

Member Function Documentation

◆ clear()

template<class Data >
void SVF::FIFOWorkList< Data >::clear ( )
inline

Clear all the data

Definition at line 227 of file WorkList.h.

228 {
229 data_list.clear();
230 data_set.clear();
231 }
DataDeque data_list
work list using std::vector.
Definition WorkList.h:235
DataSet data_set
store all data in the work list.
Definition WorkList.h:234

◆ empty()

template<class Data >
bool SVF::FIFOWorkList< Data >::empty ( ) const
inline

Definition at line 161 of file WorkList.h.

162 {
163 return data_list.empty();
164 }

◆ find()

template<class Data >
bool SVF::FIFOWorkList< Data >::find ( const Data data) const
inline

Definition at line 172 of file WorkList.h.

173 {
174 return data_set.find(data) != data_set.end();
175 }

◆ front()

template<class Data >
Data & SVF::FIFOWorkList< Data >::front ( )
inline

Get reference of top data from the END of work list.

Definition at line 205 of file WorkList.h.

206 {
207 assert(!empty() && "work list is empty");
208 Data &data = data_list.front();
209 return data;
210 }
bool empty() const
Definition WorkList.h:161

◆ pop()

template<class Data >
Data SVF::FIFOWorkList< Data >::pop ( )
inline

Pop a data from the END of work list.

Definition at line 215 of file WorkList.h.

216 {
217 assert(!empty() && "work list is empty");
218 Data data = data_list.front();
219 data_list.pop_front();
220 data_set.erase(data);
221 return data;
222 }

◆ push()

template<class Data >
bool SVF::FIFOWorkList< Data >::push ( const Data data)
inline

Push a data into the work list.

Definition at line 180 of file WorkList.h.

181 {
182 if (!find(data))
183 {
184 data_list.push_back(data);
185 data_set.insert(data);
186 return true;
187 }
188 else
189 return false;
190 }
bool find(const Data &data) const
Definition WorkList.h:172

◆ removeFront()

template<class Data >
void SVF::FIFOWorkList< Data >::removeFront ( )
inline

Remove a data from the END of work list, no return value

Definition at line 195 of file WorkList.h.

196 {
197 assert(!empty() && "work list is empty");
198 data_set.erase(front());
199 data_list.pop_front();
200 }

◆ size()

template<class Data >
u32_t SVF::FIFOWorkList< Data >::size ( ) const
inline

Definition at line 166 of file WorkList.h.

167 {
168 assert(data_list.size() == data_set.size() && "list and set must be the same size!");
169 return data_list.size();
170 }

Member Data Documentation

◆ data_list

template<class Data >
DataDeque SVF::FIFOWorkList< Data >::data_list
private

work list using std::vector.

Definition at line 235 of file WorkList.h.

◆ data_set

template<class Data >
DataSet SVF::FIFOWorkList< Data >::data_set
private

store all data in the work list.

Definition at line 234 of file WorkList.h.


The documentation for this class was generated from the following file: