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 ()
 
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 137 of file WorkList.h.

Member Typedef Documentation

◆ DataDeque

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

Definition at line 140 of file WorkList.h.

◆ DataSet

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

Definition at line 139 of file WorkList.h.

Constructor & Destructor Documentation

◆ FIFOWorkList()

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

Definition at line 142 of file WorkList.h.

142{}

◆ ~FIFOWorkList()

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

Definition at line 144 of file WorkList.h.

144{}

Member Function Documentation

◆ clear()

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

Clear all the data

Definition at line 212 of file WorkList.h.

213 {
214 data_list.clear();
215 data_set.clear();
216 }
DataDeque data_list
work list using std::vector.
Definition WorkList.h:220
DataSet data_set
store all data in the work list.
Definition WorkList.h:219

◆ empty()

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

Definition at line 146 of file WorkList.h.

147 {
148 return data_list.empty();
149 }

◆ find()

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

Definition at line 157 of file WorkList.h.

158 {
159 return data_set.find(data) != data_set.end();
160 }

◆ front()

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

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

Definition at line 190 of file WorkList.h.

191 {
192 assert(!empty() && "work list is empty");
193 Data &data = data_list.front();
194 return data;
195 }
bool empty() const
Definition WorkList.h:146
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ pop()

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

Pop a data from the END of work list.

Definition at line 200 of file WorkList.h.

201 {
202 assert(!empty() && "work list is empty");
203 Data data = data_list.front();
204 data_list.pop_front();
205 data_set.erase(data);
206 return data;
207 }

◆ push()

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

Push a data into the work list.

Definition at line 165 of file WorkList.h.

166 {
167 if (!find(data))
168 {
169 data_list.push_back(data);
170 data_set.insert(data);
171 return true;
172 }
173 else
174 return false;
175 }
bool find(const Data &data) const
Definition WorkList.h:157

◆ 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 180 of file WorkList.h.

181 {
182 assert(!empty() && "work list is empty");
183 data_set.erase(front());
184 data_list.pop_front();
185 }

◆ size()

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

Definition at line 151 of file WorkList.h.

152 {
153 assert(data_list.size() == data_set.size() && "list and set must be the same size!");
154 return data_list.size();
155 }

Member Data Documentation

◆ data_list

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

work list using std::vector.

Definition at line 220 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 219 of file WorkList.h.


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