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

#include <WorkList.h>

Public Member Functions

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

Private Types

typedef Set< DataDataSet
 
typedef std::vector< DataDataVector
 

Private Attributes

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

Detailed Description

template<class Data>
class SVF::FILOWorkList< Data >

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

Definition at line 244 of file WorkList.h.

Member Typedef Documentation

◆ DataSet

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

Definition at line 246 of file WorkList.h.

◆ DataVector

template<class Data >
typedef std::vector<Data> SVF::FILOWorkList< Data >::DataVector
private

Definition at line 247 of file WorkList.h.

Constructor & Destructor Documentation

◆ FILOWorkList() [1/3]

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

Definition at line 249 of file WorkList.h.

249{}

◆ FILOWorkList() [2/3]

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

Construct from a vector, pushing all elements in order.

Definition at line 252 of file WorkList.h.

253 {
254 for (const Data& d : vec)
255 push(d);
256 }
bool push(const Data &data)
Definition WorkList.h:286
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ FILOWorkList() [3/3]

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

Construct from a list, pushing all elements in order.

Definition at line 259 of file WorkList.h.

260 {
261 for (const Data& d : lst)
262 push(d);
263 }

◆ ~FILOWorkList()

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

Definition at line 265 of file WorkList.h.

265{}

Member Function Documentation

◆ back()

template<class Data >
Data & SVF::FILOWorkList< Data >::back ( )
inline

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

Definition at line 323 of file WorkList.h.

324 {
325 assert(!empty() && "work list is empty");
326 Data &data = data_list.back();
327 return data;
328 }
bool empty() const
Definition WorkList.h:267
DataVector data_list
work list using std::vector.
Definition WorkList.h:341

◆ clear()

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

Clear all the data

Definition at line 333 of file WorkList.h.

334 {
335 data_list.clear();
336 data_set.clear();
337 }
DataSet data_set
store all data in the work list.
Definition WorkList.h:340

◆ empty()

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

Definition at line 267 of file WorkList.h.

268 {
269 return data_list.empty();
270 }

◆ find()

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

Definition at line 278 of file WorkList.h.

279 {
280 return data_set.find(data) != data_set.end();;
281 }

◆ pop()

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

Pop a data from the END of work list.

Definition at line 301 of file WorkList.h.

302 {
303 assert(!empty() && "work list is empty");
304 Data data = data_list.back();
305 data_list.pop_back();
306 data_set.erase(data);
307 return data;
308 }

◆ push()

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

Push a data into the work list.

Definition at line 286 of file WorkList.h.

287 {
288 if (!find(data))
289 {
290 data_list.push_back(data);
291 data_set.insert(data);
292 return true;
293 }
294 else
295 return false;
296 }
bool find(const Data &data) const
Definition WorkList.h:278

◆ removeBack()

template<class Data >
void SVF::FILOWorkList< Data >::removeBack ( )
inline

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

Definition at line 313 of file WorkList.h.

314 {
315 assert(!empty() && "work list is empty");
316 data_set.erase(back());
317 data_list.pop_back();
318 }

◆ size()

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

Definition at line 272 of file WorkList.h.

273 {
274 assert(data_list.size() == data_set.size() && "list and set must be the same size!");
275 return data_list.size();
276 }

Member Data Documentation

◆ data_list

template<class Data >
DataVector SVF::FILOWorkList< Data >::data_list
private

work list using std::vector.

Definition at line 341 of file WorkList.h.

◆ data_set

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

store all data in the work list.

Definition at line 340 of file WorkList.h.


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