Predator  [unstable] git snapshot
Data Structures | Typedefs | Functions | Variables
IR Namespace Reference

Data Structures

struct  Range
 a closed interval over integral domain More...

Typedefs

typedef signed long TInt
typedef unsigned long TUInt

Functions

Range rngFromNum (TInt num)
TInt extendSignedIntFromLeft (TInt num)
 insert ones as padding from left
void chkRange (const Range &rng)
 this does nothing unless running a debug build
bool operator== (const Range &a, const Range &b)
bool operator!= (const Range &a, const Range &b)
TInt invertInt (TInt)
 invert polarity of the number
Range operator- (Range rng)
 invert polarity of the range
Rangeoperator+= (Range &rng, const Range &other)
 add another range, but preserve boundary values if already reached
Rangeoperator*= (Range &rng, const Range &other)
 multiply by another range, but preserve boundary values if already reached
Rangeoperator&= (Range &rng, TInt mask)
 bitwise AND on range where the bitmask is a single number
Rangeoperator<<= (Range &rng, TUInt)
Rangeoperator>>= (Range &rng, TUInt)
Rangeoperator-= (Range &rng, const Range &other)
 subtract another range, but preserve boundary values if already reached
Range operator+ (Range rng, const Range &other)
Range operator* (Range rng, const Range &other)
Range operator- (Range rng, const Range &other)
Range operator& (Range rng, TInt mask)
Range operator<< (Range rng, TUInt n)
Range operator>> (Range rng, TUInt n)
Range join (const Range &rng1, const Range &rng2)
 return a range that covers both given ranges, preserve alignment if possible
bool isRangeByNum (bool *pIsRange1, const Range &rng1, const Range &rng2)
 return true if exactly one of the given ranges represents a single number
bool isCovered (const Range &small, const Range &big)
 true if the small range is inside the big one (sharing endpoints is fine)
bool isSingular (const Range &)
 return true if the range contain exactly one number; break if no one at all
bool isAligned (const Range &)
 return true if the range is non-trivially aligned
void adjustAlignment (Range *)
 adjust the alignment so that the bounds are aligned
TUInt widthOf (const Range &)
 return the count of integral numbers that the given range represents

Variables

const TInt Int0
const TInt Int1
const TInt IntMin
const TInt IntMax
const Range FullRange

Typedef Documentation

typedef signed long TInt

Definition at line 31 of file intrange.hh.

typedef unsigned long TUInt

Definition at line 32 of file intrange.hh.

Function Documentation

void IR::adjustAlignment ( Range *  )

adjust the alignment so that the bounds are aligned

void IR::chkRange ( const Range &  rng)

this does nothing unless running a debug build

TInt IR::extendSignedIntFromLeft ( TInt  num)

insert ones as padding from left

TInt IR::invertInt ( TInt  )

invert polarity of the number

Referenced by operator-().

bool IR::isAligned ( const Range &  )

return true if the range is non-trivially aligned

bool IR::isCovered ( const Range &  small,
const Range &  big 
)

true if the small range is inside the big one (sharing endpoints is fine)

bool IR::isRangeByNum ( bool *  pIsRange1,
const Range &  rng1,
const Range &  rng2 
)

return true if exactly one of the given ranges represents a single number

bool IR::isSingular ( const Range &  )

return true if the range contain exactly one number; break if no one at all

Referenced by traverseProgramVarsGeneric().

Range IR::join ( const Range &  rng1,
const Range &  rng2 
)

return a range that covers both given ranges, preserve alignment if possible

bool IR::operator!= ( const Range &  a,
const Range &  b 
)
inline

Definition at line 75 of file intrange.hh.

References operator==().

Range IR::operator& ( Range  rng,
TInt  mask 
)
inline

Definition at line 130 of file intrange.hh.

Range& IR::operator&= ( Range &  rng,
TInt  mask 
)

bitwise AND on range where the bitmask is a single number

Range IR::operator* ( Range  rng,
const Range &  other 
)
inline

Definition at line 118 of file intrange.hh.

Range& IR::operator*= ( Range &  rng,
const Range &  other 
)

multiply by another range, but preserve boundary values if already reached

Range IR::operator+ ( Range  rng,
const Range &  other 
)
inline

Definition at line 112 of file intrange.hh.

Range& IR::operator+= ( Range &  rng,
const Range &  other 
)

add another range, but preserve boundary values if already reached

Range IR::operator- ( Range  rng)
inline

invert polarity of the range

Definition at line 84 of file intrange.hh.

References Range::hi, invertInt(), and Range::lo.

Range IR::operator- ( Range  rng,
const Range &  other 
)
inline

Definition at line 124 of file intrange.hh.

Range& IR::operator-= ( Range &  rng,
const Range &  other 
)
inline

subtract another range, but preserve boundary values if already reached

Definition at line 106 of file intrange.hh.

Range IR::operator<< ( Range  rng,
TUInt  n 
)
inline

Definition at line 136 of file intrange.hh.

Range& IR::operator<<= ( Range &  rng,
TUInt   
)
bool IR::operator== ( const Range &  a,
const Range &  b 
)
inline

Definition at line 68 of file intrange.hh.

References Range::alignment, Range::hi, and Range::lo.

Referenced by operator!=().

Range IR::operator>> ( Range  rng,
TUInt  n 
)
inline

Definition at line 142 of file intrange.hh.

Range& IR::operator>>= ( Range &  rng,
TUInt   
)
Range IR::rngFromNum ( TInt  num)
inline

Definition at line 49 of file intrange.hh.

References Range::alignment, Range::hi, Int1, and Range::lo.

TUInt IR::widthOf ( const Range &  )

return the count of integral numbers that the given range represents

Variable Documentation

const Range FullRange
const TInt Int0
const TInt Int1

Referenced by rngFromNum().

const TInt IntMax
const TInt IntMin