LLVM API Documentation

Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy > Class Template Reference

#include <IntegersSubsetMapping.h>

Collaboration diagram for llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >:
Collaboration graph
[legend]

List of all members.

Classes

struct  ClustersCmp
class  DiffStateMachine
struct  RangeEx

Public Types

typedef IntRange< IntTy > RangeTy
typedef std::pair< RangeEx,
SuccessorClass * > 
Cluster
typedef std::list< RangeTyRangesCollection
typedef RangesCollection::iterator RangesCollectionIt
typedef
RangesCollection::const_iterator 
RangesCollectionConstIt
typedef IntegersSubsetMapping
< SuccessorClass,
IntegersSubsetTy, IntTy > 
self
typedef CaseItemIt RangeIterator
typedef std::pair
< SuccessorClass
*, IntegersSubsetTy > 
Case
typedef std::list< CaseCases
typedef Cases::iterator CasesIt

Public Member Functions

 IntegersSubsetMapping ()
bool verify ()
bool verify (RangeIterator &errItem)
bool isOverlapped (self &RHS)
void optimize ()
void add (const IntTy &C, SuccessorClass *S=0)
 Adds a constant value.
void add (const IntTy &Low, const IntTy &High, SuccessorClass *S=0)
 Adds a range.
void add (const RangeTy &R, SuccessorClass *S=0)
void add (const RangeEx &R, SuccessorClass *S=0)
void add (const IntegersSubsetTy &CRS, SuccessorClass *S=0, unsigned Weight=0)
void add (self &RHS)
void add (self &RHS, SuccessorClass *S)
void add (const RangesCollection &RHS, SuccessorClass *S=0)
void removeItem (RangeIterator i)
 Removes items from set.
void detachCase (self &NewMapping, SuccessorClass *Succ)
 Moves whole case from current mapping to the NewMapping object.
void removeCase (SuccessorClass *Succ)
 Removes all clusters for given successor.
SuccessorClass * findSuccessor (const IntTy &Val)
 Find successor that satisfies given value.
void diff (self *LExclude, self *Intersection, self *RExclude, const self &RHS)
void getCases (Cases &TheCases, bool PreventMerging=false)
 Builds the finalized case objects.
IntegersSubsetTy getCase ()
const IntTy * getCaseSingleNumber (SuccessorClass *Succ)
bool empty () const
 Returns true if there is no ranges and values inside.
void clear ()
unsigned size () const
RangeIterator begin ()
RangeIterator end ()

Protected Types

enum  DiffProcessState { L_OPENED, INTERSECT_OPENED, R_OPENED, ALL_IS_CLOSED }
typedef std::list< ClusterCaseItems
typedef CaseItems::iterator CaseItemIt
typedef CaseItems::const_iterator CaseItemConstIt
typedef std::map
< SuccessorClass
*, RangesCollection
CRSMap
typedef CRSMap::iterator CRSMapIt

Protected Member Functions

bool isIntersected (CaseItemIt &LItem, CaseItemIt &RItem)
bool isJoinable (CaseItemIt &LItem, CaseItemIt &RItem)
void sort ()

Protected Attributes

CaseItems Items
bool Sorted

Detailed Description

template<class SuccessorClass, class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
class llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >

Definition at line 33 of file IntegersSubsetMapping.h.


Member Typedef Documentation

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef std::pair<SuccessorClass*, IntegersSubsetTy> llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::Case

Definition at line 258 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef CaseItems::const_iterator llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::CaseItemConstIt [protected]

Definition at line 64 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef CaseItems::iterator llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::CaseItemIt [protected]

Definition at line 63 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef std::list<Cluster> llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::CaseItems [protected]

Definition at line 62 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef std::list<Case> llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::Cases

Definition at line 259 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef Cases::iterator llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::CasesIt

Definition at line 260 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef std::pair<RangeEx, SuccessorClass*> llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::Cluster

Definition at line 53 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef std::map<SuccessorClass*, RangesCollection > llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::CRSMap [protected]

Definition at line 67 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef CRSMap::iterator llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::CRSMapIt [protected]

Definition at line 68 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef CaseItemIt llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::RangeIterator

Definition at line 256 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef std::list<RangeTy> llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::RangesCollection

Definition at line 55 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef RangesCollection::const_iterator llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::RangesCollectionConstIt

Definition at line 57 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef RangesCollection::iterator llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::RangesCollectionIt

Definition at line 56 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef IntRange<IntTy> llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::RangeTy

Definition at line 40 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
typedef IntegersSubsetMapping<SuccessorClass, IntegersSubsetTy, IntTy> llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::self

Definition at line 58 of file IntegersSubsetMapping.h.


Member Enumeration Documentation

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
enum llvm::IntegersSubsetMapping::DiffProcessState [protected]
Enumerator:
L_OPENED 
INTERSECT_OPENED 
R_OPENED 
ALL_IS_CLOSED 

Definition at line 107 of file IntegersSubsetMapping.h.


Constructor & Destructor Documentation

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::IntegersSubsetMapping ( ) [inline]

Member Function Documentation

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::add ( const IntTy &  C,
SuccessorClass *  S = 0 
) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::add ( const IntTy &  Low,
const IntTy &  High,
SuccessorClass *  S = 0 
) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::add ( const RangeTy R,
SuccessorClass *  S = 0 
) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::add ( const RangeEx R,
SuccessorClass *  S = 0 
) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::add ( const IntegersSubsetTy &  CRS,
SuccessorClass *  S = 0,
unsigned  Weight = 0 
) [inline]

Adds all ranges and values from given ranges set to the current mapping.

Definition at line 366 of file IntegersSubsetMapping.h.

References llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::add().

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::add ( self RHS) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::add ( self RHS,
SuccessorClass *  S 
) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::add ( const RangesCollection RHS,
SuccessorClass *  S = 0 
) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
RangeIterator llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::begin ( ) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::clear ( ) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::detachCase ( self NewMapping,
SuccessorClass *  Succ 
) [inline]

Moves whole case from current mapping to the NewMapping object.

Definition at line 398 of file IntegersSubsetMapping.h.

References llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::Items.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::diff ( self LExclude,
self Intersection,
self RExclude,
const self RHS 
) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
bool llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::empty ( ) const [inline]

Returns true if there is no ranges and values inside.

Definition at line 565 of file IntegersSubsetMapping.h.

References llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::Items.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
RangeIterator llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::end ( ) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
SuccessorClass* llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::findSuccessor ( const IntTy &  Val) [inline]

Find successor that satisfies given value.

Definition at line 417 of file IntegersSubsetMapping.h.

References llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::Items.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
IntegersSubsetTy llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::getCase ( ) [inline]

Builds the finalized case objects ignoring successor values, as though all ranges belongs to the same successor.

Definition at line 541 of file IntegersSubsetMapping.h.

References llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::begin(), and llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::end().

Referenced by llvm::SwitchInst::addCase(), and llvm::SwitchInst::CaseIt::setValue().

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::getCases ( Cases TheCases,
bool  PreventMerging = false 
) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
const IntTy* llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::getCaseSingleNumber ( SuccessorClass *  Succ) [inline]

Returns pointer to value of case if it is single-numbered or 0 in another case.

Definition at line 550 of file IntegersSubsetMapping.h.

References llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::Items.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
bool llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::isIntersected ( CaseItemIt LItem,
CaseItemIt RItem 
) [inline, protected]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
bool llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::isJoinable ( CaseItemIt LItem,
CaseItemIt RItem 
) [inline, protected]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
bool llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::isOverlapped ( self RHS) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::optimize ( ) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::removeCase ( SuccessorClass *  Succ) [inline]

Removes all clusters for given successor.

Definition at line 408 of file IntegersSubsetMapping.h.

References llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::Items.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::removeItem ( RangeIterator  i) [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
unsigned llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::size ( ) const [inline]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
void llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::sort ( ) [inline, protected]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
bool llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::verify ( ) [inline]

Definition at line 266 of file IntegersSubsetMapping.h.

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
bool llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::verify ( RangeIterator errItem) [inline]

Member Data Documentation

template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
CaseItems llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::Items [protected]
template<class SuccessorClass , class IntegersSubsetTy = IntegersSubset, class IntTy = IntItem>
bool llvm::IntegersSubsetMapping< SuccessorClass, IntegersSubsetTy, IntTy >::Sorted [protected]

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