PandA-2024.02
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
Range Class Reference

#include <Range.hpp>

Inheritance diagram for Range:
Inheritance graph
[legend]
Collaboration diagram for Range:
Collaboration graph
[legend]

Public Types

using bw_t = APInt::bw_t
 

Public Member Functions

 Range (RangeType type, bw_t bw)
 
 Range (RangeType rType, bw_t bw, const APInt &lb, const APInt &ub)
 
virtual ~Range ()=default
 
 Range (const Range &other)=default
 
 Range (Range &&)=default
 
Rangeoperator= (const Range &other)=default
 
Rangeoperator= (Range &&)=default
 
bw_t getBitWidth () const
 
const APIntgetLower () const
 
const APIntgetUpper () const
 
APInt getSignedMax () const
 
APInt getSignedMin () const
 
APInt getUnsignedMax () const
 
APInt getUnsignedMin () const
 
APInt getSpan () const
 
virtual std::deque< bit_latticegetBitValues (bool isSigned) const
 
virtual RangeRef getAnti () const
 
virtual bool isUnknown () const
 
virtual void setUnknown ()
 
bool isRegular () const
 
bool isAnti () const
 
virtual bool isEmpty () const
 
virtual bool isReal () const
 
bool operator== (const Range &other) const =delete
 
bool operator!= (const Range &other) const =delete
 
bool isSameType (const RangeConstRef &other) const
 
virtual bool isSameRange (const RangeConstRef &other) const
 
virtual bool isFullSet () const
 
virtual bool isSingleElement () const
 
virtual bool isConstant () const
 
virtual Rangeclone () const
 
virtual void print (std::ostream &OS) const
 
std::string ToString () const
 
RangeRef add (const RangeConstRef &other) const
 
RangeRef sat_add (const RangeConstRef &other) const
 
RangeRef usat_add (const RangeConstRef &other) const
 
RangeRef sub (const RangeConstRef &other) const
 
RangeRef sat_sub (const RangeConstRef &other) const
 
RangeRef usat_sub (const RangeConstRef &other) const
 
RangeRef mul (const RangeConstRef &other) const
 
RangeRef udiv (const RangeConstRef &other) const
 
RangeRef sdiv (const RangeConstRef &other) const
 
RangeRef urem (const RangeConstRef &other) const
 
RangeRef srem (const RangeConstRef &other) const
 
RangeRef shl (const RangeConstRef &other) const
 
RangeRef shr (const RangeConstRef &other, bool sign) const
 
virtual RangeRef abs () const
 
virtual RangeRef negate () const
 
RangeRef Not () const
 
RangeRef And (const RangeConstRef &other) const
 
RangeRef Or (const RangeConstRef &other) const
 
RangeRef Xor (const RangeConstRef &other) const
 
virtual RangeRef Eq (const RangeConstRef &other, bw_t bw) const
 
virtual RangeRef Ne (const RangeConstRef &other, bw_t bw) const
 
RangeRef Ugt (const RangeConstRef &other, bw_t bw) const
 
RangeRef Uge (const RangeConstRef &other, bw_t bw) const
 
RangeRef Ult (const RangeConstRef &other, bw_t bw) const
 
RangeRef Ule (const RangeConstRef &other, bw_t bw) const
 
RangeRef UMin (const RangeConstRef &other) const
 
RangeRef UMax (const RangeConstRef &other) const
 
RangeRef Sgt (const RangeConstRef &other, bw_t bw) const
 
RangeRef Sge (const RangeConstRef &other, bw_t bw) const
 
RangeRef Slt (const RangeConstRef &other, bw_t bw) const
 
RangeRef Sle (const RangeConstRef &other, bw_t bw) const
 
RangeRef SMin (const RangeConstRef &other) const
 
RangeRef SMax (const RangeConstRef &other) const
 
RangeRef sextOrTrunc (bw_t bitwidth) const
 
RangeRef zextOrTrunc (bw_t bitwidth) const
 
RangeRef truncate (bw_t bitwidth) const
 
virtual RangeRef intersectWith (const RangeConstRef &other) const
 
virtual RangeRef unionWith (const RangeConstRef &other) const
 

Static Public Member Functions

static RangeRef makeSatisfyingCmpRegion (kind pred, const RangeConstRef &Other)
 
static bw_t neededBits (const APInt &a, const APInt &b, bool sign)
 
static RangeRef fromBitValues (const std::deque< bit_lattice > &bv, bw_t bitwidth, bool isSigned)
 

Static Public Attributes

static const bw_t max_digits = static_cast<bw_t>(std::numeric_limits<APInt::number>::digits)
 
static const APInt Min = APInt::getSignedMinValue(Range::max_digits)
 
static const APInt Max = APInt::getSignedMaxValue(Range::max_digits)
 
static const APInt MinDelta
 

Private Member Functions

void normalizeRange (const APInt &lb, const APInt &ub, RangeType rType)
 

Private Attributes

APInt l
 The lower bound of the range. More...
 
APInt u
 The upper bound of the range. More...
 
bw_t bw
 the range bit-width More...
 
RangeType type
 the range type More...
 

Detailed Description

Definition at line 63 of file Range.hpp.

Member Typedef Documentation

◆ bw_t

Definition at line 66 of file Range.hpp.

Constructor & Destructor Documentation

◆ Range() [1/4]

Range::Range ( RangeType  type,
bw_t  bw 
)

◆ Range() [2/4]

Range::Range ( RangeType  rType,
bw_t  bw,
const APInt lb,
const APInt ub 
)

Definition at line 82 of file Range.cpp.

References max_digits, normalizeRange(), STR, and THROW_ASSERT.

Here is the call graph for this function:

◆ ~Range()

virtual Range::~Range ( )
virtualdefault

◆ Range() [3/4]

Range::Range ( const Range other)
default

◆ Range() [4/4]

Range::Range ( Range &&  )
default

Member Function Documentation

◆ abs()

RangeRef Range::abs ( ) const
virtual

Reimplemented in RealRange.

Definition at line 2058 of file Range.cpp.

References Anti, bw, clone(), getSignedMax(), APInt::getSignedMaxValue(), getSignedMin(), APInt::getSignedMinValue(), isAnti(), isEmpty(), isUnknown(), l, max, min, Range(), Regular, and u.

Referenced by normalizeRange(), and truncate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add()

RangeRef Range::add ( const RangeConstRef &  other) const

Definition at line 652 of file Range.cpp.

References Anti, bw, getLower(), getSpan(), getUpper(), isAnti(), isFullSet(), isReal(), l, max, Max, Min, min, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, THROW_ASSERT, and u.

Here is the call graph for this function:

◆ And()

RangeRef Range::And ( const RangeConstRef &  other) const

Definition at line 1635 of file Range.cpp.

References AND, bw, clone(), getLower(), getSignedMax(), getUpper(), isAnti(), isConstant(), isReal(), Max, Min, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, and THROW_ASSERT.

Referenced by RealRange::Eq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clone()

Range * Range::clone ( ) const
virtual

Reimplemented in RealRange.

Definition at line 88 of file Range.cpp.

References Range().

Referenced by abs(), And(), getAnti(), intersectWith(), negate(), Or(), sat_add(), sat_sub(), SMax(), SMin(), srem(), truncate(), UMax(), UMin(), unionWith(), usat_sub(), and Xor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Eq()

RangeRef Range::Eq ( const RangeConstRef &  other,
bw_t  bw 
) const
virtual

Reimplemented in RealRange.

Definition at line 1699 of file Range.cpp.

References intersectWith(), isAnti(), isSameRange(), l, Max, Min, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, THROW_ASSERT, THROW_UNREACHABLE, and u.

Here is the call graph for this function:

◆ fromBitValues()

RangeRef Range::fromBitValues ( const std::deque< bit_lattice > &  bv,
bw_t  bitwidth,
bool  isSigned 
)
static

Definition at line 365 of file Range.cpp.

References APInt::extOrTrunc(), max, min, ONE, Range(), Regular, BitLatticeManipulator::sign_extend_bitstring(), THROW_ASSERT, U, X, and ZERO.

Referenced by RealRange::fromBitValues().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAnti()

RangeRef Range::getAnti ( ) const
virtual

Reimplemented in RealRange.

Definition at line 464 of file Range.cpp.

References Anti, bw, clone(), Empty, l, Range(), Real, Regular, THROW_UNREACHABLE, type, u, and Unknown.

Referenced by intersectWith(), and unionWith().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBitValues()

std::deque< bit_lattice > Range::getBitValues ( bool  isSigned) const
virtual

◆ getBitWidth()

bw_t Range::getBitWidth ( ) const

Definition at line 490 of file Range.cpp.

References bw.

Referenced by RealRange::getBitValues(), RealRange::getRange(), RealRange::isSameRange(), RealRange::print(), RealRange::RealRange(), RealRange::toFloat32(), and RealRange::toFloat64().

Here is the caller graph for this function:

◆ getLower()

const APInt & Range::getLower ( ) const

Definition at line 495 of file Range.cpp.

References isAnti(), isReal(), l, and THROW_ASSERT.

Referenced by add(), And(), intersectWith(), isFullSet(), Or(), sat_add(), sat_sub(), sdiv(), shl(), srem(), sub(), unionWith(), usat_add(), usat_sub(), and Xor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSignedMax()

APInt Range::getSignedMax ( ) const

Definition at line 509 of file Range.cpp.

References bw, APInt::getSignedMaxValue(), isEmpty(), isReal(), isUnknown(), Regular, THROW_ASSERT, type, and u.

Referenced by abs(), And(), getBitValues(), mul(), Or(), sextOrTrunc(), Sge(), Sgt(), shr(), Sle(), Slt(), SMax(), SMin(), truncate(), and zextOrTrunc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSignedMin()

APInt Range::getSignedMin ( ) const

Definition at line 521 of file Range.cpp.

References bw, APInt::getSignedMinValue(), isEmpty(), isReal(), isUnknown(), l, Regular, THROW_ASSERT, and type.

Referenced by abs(), getBitValues(), mul(), sextOrTrunc(), Sge(), Sgt(), shr(), Sle(), Slt(), SMax(), SMin(), truncate(), and zextOrTrunc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSpan()

APInt Range::getSpan ( ) const

Definition at line 557 of file Range.cpp.

References bw, APInt::getMaxValue(), APInt::getSignedMaxValue(), APInt::getSignedMinValue(), isAnti(), isEmpty(), isFullSet(), isReal(), isUnknown(), l, Max, Min, THROW_ASSERT, and u.

Referenced by add(), sat_add(), sat_sub(), sub(), usat_add(), and usat_sub().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUnsignedMax()

APInt Range::getUnsignedMax ( ) const

Definition at line 533 of file Range.cpp.

References bw, APInt::extOrTrunc(), APInt::getMaxValue(), isAnti(), isEmpty(), isReal(), isUnknown(), l, MinDelta, THROW_ASSERT, and u.

Referenced by getBitValues(), mul(), shr(), udiv(), Uge(), Ugt(), Ule(), Ult(), UMax(), UMin(), urem(), and zextOrTrunc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUnsignedMin()

APInt Range::getUnsignedMin ( ) const

Definition at line 546 of file Range.cpp.

References bw, APInt::extOrTrunc(), APInt::getMinValue(), isAnti(), isEmpty(), isReal(), isUnknown(), l, MinDelta, THROW_ASSERT, and u.

Referenced by getBitValues(), mul(), shr(), udiv(), Uge(), Ugt(), Ule(), Ult(), UMax(), UMin(), and urem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUpper()

const APInt & Range::getUpper ( ) const

Definition at line 502 of file Range.cpp.

References isAnti(), isReal(), THROW_ASSERT, and u.

Referenced by add(), And(), intersectWith(), isFullSet(), Or(), sat_add(), sat_sub(), sdiv(), shl(), srem(), sub(), unionWith(), usat_add(), usat_sub(), and Xor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersectWith()

RangeRef Range::intersectWith ( const RangeConstRef &  other) const
virtual

Reimplemented in RealRange.

Definition at line 2242 of file Range.cpp.

References Anti, bw, clone(), Empty, getAnti(), getLower(), getUpper(), isAnti(), isReal(), Max, Min, PRINT_MSG, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, and THROW_ASSERT.

Referenced by Eq(), and Ne().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isAnti()

bool Range::isAnti ( ) const

◆ isConstant()

bool Range::isConstant ( ) const
virtual

Reimplemented in RealRange.

Definition at line 636 of file Range.cpp.

References isRegular(), l, and u.

Referenced by And(), getBitValues(), Or(), and shl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEmpty()

bool Range::isEmpty ( ) const
virtual

Reimplemented in RealRange.

Definition at line 597 of file Range.cpp.

References Empty, and type.

Referenced by abs(), getBitValues(), getSignedMax(), getSignedMin(), getSpan(), getUnsignedMax(), getUnsignedMin(), isFullSet(), isSingleElement(), negate(), Not(), print(), sextOrTrunc(), truncate(), unionWith(), and zextOrTrunc().

Here is the caller graph for this function:

◆ isFullSet()

bool Range::isFullSet ( ) const
virtual

Reimplemented in RealRange.

Definition at line 617 of file Range.cpp.

References bw, getLower(), APInt::getSignedMaxValue(), APInt::getSignedMinValue(), getUpper(), isAnti(), isEmpty(), isUnknown(), and THROW_ASSERT.

Referenced by add(), getSpan(), mul(), sat_add(), sat_sub(), sdiv(), shl(), srem(), sub(), truncate(), udiv(), usat_add(), and usat_sub().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isReal()

bool Range::isReal ( ) const
virtual

◆ isRegular()

bool Range::isRegular ( ) const

Definition at line 587 of file Range.cpp.

References Regular, and type.

Referenced by isConstant().

Here is the caller graph for this function:

◆ isSameRange()

bool Range::isSameRange ( const RangeConstRef &  other) const
virtual

Reimplemented in RealRange.

Definition at line 612 of file Range.cpp.

References bw, isSameType(), l, and u.

Referenced by Eq(), and Ne().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSameType()

bool Range::isSameType ( const RangeConstRef &  other) const

Definition at line 607 of file Range.cpp.

References type.

Referenced by isSameRange().

Here is the caller graph for this function:

◆ isSingleElement()

bool Range::isSingleElement ( ) const
virtual

Reimplemented in RealRange.

Definition at line 627 of file Range.cpp.

References isEmpty(), isUnknown(), l, and u.

Here is the call graph for this function:

◆ isUnknown()

bool Range::isUnknown ( ) const
virtual

Reimplemented in RealRange.

Definition at line 577 of file Range.cpp.

References type, and Unknown.

Referenced by abs(), getBitValues(), getSignedMax(), getSignedMin(), getSpan(), getUnsignedMax(), getUnsignedMin(), isFullSet(), isSingleElement(), negate(), Not(), print(), sextOrTrunc(), truncate(), unionWith(), and zextOrTrunc().

Here is the caller graph for this function:

◆ makeSatisfyingCmpRegion()

RangeRef Range::makeSatisfyingCmpRegion ( kind  pred,
const RangeConstRef &  Other 
)
static

◆ mul()

RangeRef Range::mul ( const RangeConstRef &  other) const

◆ Ne()

RangeRef Range::Ne ( const RangeConstRef &  other,
bw_t  bw 
) const
virtual

Reimplemented in RealRange.

Definition at line 1735 of file Range.cpp.

References intersectWith(), isAnti(), isSameRange(), l, Max, Min, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, THROW_ASSERT, THROW_UNREACHABLE, and u.

Here is the call graph for this function:

◆ neededBits()

bw_t Range::neededBits ( const APInt a,
const APInt b,
bool  sign 
)
static

Definition at line 360 of file Range.cpp.

References max, and APInt::minBitwidth().

Referenced by VarNode::updateIR().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ negate()

RangeRef Range::negate ( ) const
virtual

Reimplemented in RealRange.

Definition at line 2108 of file Range.cpp.

References Anti, bw, clone(), isAnti(), isEmpty(), isReal(), isUnknown(), l, Range(), Regular, THROW_ASSERT, and u.

Here is the call graph for this function:

◆ normalizeRange()

void Range::normalizeRange ( const APInt lb,
const APInt ub,
RangeType  rType 
)
private

Definition at line 93 of file Range.cpp.

References abs(), Anti, bw, Empty, APInt::extOrTrunc(), APInt::getMaxValue(), APInt::getSignedMaxValue(), APInt::getSignedMinValue(), l, Max, Min, MinDelta, Real, Regular, THROW_ASSERT, THROW_UNREACHABLE, type, u, and Unknown.

Referenced by Range().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Not()

RangeRef Range::Not ( ) const

Definition at line 1685 of file Range.cpp.

References bw, isEmpty(), isReal(), isUnknown(), max, min, Range(), THROW_ASSERT, and type.

Here is the call graph for this function:

◆ operator!=()

bool Range::operator!= ( const Range other) const
delete

◆ operator=() [1/2]

Range& Range::operator= ( const Range other)
default

◆ operator=() [2/2]

Range& Range::operator= ( Range &&  )
default

◆ operator==()

bool Range::operator== ( const Range other) const
delete

◆ Or()

RangeRef Range::Or ( const RangeConstRef &  other) const

Definition at line 1612 of file Range.cpp.

References bw, clone(), getLower(), getSignedMax(), getUpper(), isAnti(), isConstant(), isReal(), Max, Min, OR, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, and THROW_ASSERT.

Here is the call graph for this function:

◆ print()

void Range::print ( std::ostream &  OS) const
virtual

Reimplemented in RealRange.

Definition at line 2464 of file Range.cpp.

References bw, isAnti(), isEmpty(), isUnknown(), l, Max, Min, and u.

Referenced by operator<<(), and ToString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sat_add()

RangeRef Range::sat_add ( const RangeConstRef &  other) const

◆ sat_sub()

RangeRef Range::sat_sub ( const RangeConstRef &  other) const

◆ sdiv()

RangeRef Range::sdiv ( const RangeConstRef &  other) const

could be improved

could be improved

Definition at line 1091 of file Range.cpp.

References bw, c1, c2, DIV_HELPER, getLower(), getUpper(), isAnti(), isFullSet(), isReal(), Max, Min, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, THROW_ASSERT, and u.

Here is the call graph for this function:

◆ setUnknown()

void Range::setUnknown ( )
virtual

Reimplemented in RealRange.

Definition at line 582 of file Range.cpp.

References type, and Unknown.

◆ sextOrTrunc()

RangeRef Range::sextOrTrunc ( bw_t  bitwidth) const

Definition at line 2181 of file Range.cpp.

References bw, Empty, getSignedMax(), getSignedMin(), isEmpty(), isReal(), isUnknown(), Range(), Regular, THROW_ASSERT, truncate(), and Unknown.

Here is the call graph for this function:

◆ Sge()

RangeRef Range::Sge ( const RangeConstRef &  other,
bw_t  bw 
) const

Definition at line 1900 of file Range.cpp.

References getSignedMax(), getSignedMin(), isAnti(), isReal(), Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, and THROW_ASSERT.

Here is the call graph for this function:

◆ Sgt()

RangeRef Range::Sgt ( const RangeConstRef &  other,
bw_t  bw 
) const

Definition at line 1874 of file Range.cpp.

References getSignedMax(), getSignedMin(), isAnti(), isReal(), Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, and THROW_ASSERT.

Referenced by SMax().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shl()

RangeRef Range::shl ( const RangeConstRef &  other) const

◆ shr()

RangeRef Range::shr ( const RangeConstRef &  other,
bool  sign 
) const

◆ Sle()

RangeRef Range::Sle ( const RangeConstRef &  other,
bw_t  bw 
) const

Definition at line 1952 of file Range.cpp.

References getSignedMax(), getSignedMin(), isAnti(), isReal(), Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, and THROW_ASSERT.

Here is the call graph for this function:

◆ Slt()

RangeRef Range::Slt ( const RangeConstRef &  other,
bw_t  bw 
) const

Definition at line 1926 of file Range.cpp.

References getSignedMax(), getSignedMin(), isAnti(), isReal(), Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, and THROW_ASSERT.

Referenced by SMin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SMax()

RangeRef Range::SMax ( const RangeConstRef &  other) const

Definition at line 1998 of file Range.cpp.

References bw, clone(), getSignedMax(), getSignedMin(), isAnti(), isReal(), max, min, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, Sgt(), and THROW_ASSERT.

Here is the call graph for this function:

◆ SMin()

RangeRef Range::SMin ( const RangeConstRef &  other) const

Definition at line 1978 of file Range.cpp.

References bw, clone(), getSignedMax(), getSignedMin(), isAnti(), isReal(), max, min, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, Slt(), and THROW_ASSERT.

Here is the call graph for this function:

◆ srem()

RangeRef Range::srem ( const RangeConstRef &  other) const

Definition at line 1229 of file Range.cpp.

References bw, clone(), getLower(), getUpper(), isAnti(), isFullSet(), isReal(), max, min, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, and THROW_ASSERT.

Here is the call graph for this function:

◆ sub()

RangeRef Range::sub ( const RangeConstRef &  other) const

Definition at line 819 of file Range.cpp.

References Anti, bw, getLower(), APInt::getSignedMaxValue(), APInt::getSignedMinValue(), getSpan(), getUpper(), isAnti(), isFullSet(), isReal(), l, max, Max, Min, min, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, THROW_ASSERT, and u.

Referenced by Xor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToString()

std::string Range::ToString ( ) const

Definition at line 2516 of file Range.cpp.

References print().

Referenced by RealRange::RealRange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ truncate()

RangeRef Range::truncate ( bw_t  bitwidth) const

Definition at line 2125 of file Range.cpp.

References abs(), Anti, bw, clone(), Empty, APInt::getMaxValue(), getSignedMax(), getSignedMin(), isAnti(), isEmpty(), isFullSet(), isReal(), isUnknown(), Range(), Regular, THROW_ASSERT, and Unknown.

Referenced by sextOrTrunc(), and zextOrTrunc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ udiv()

RangeRef Range::udiv ( const RangeConstRef &  other) const

Definition at line 1057 of file Range.cpp.

References bw, getUnsignedMax(), getUnsignedMin(), isFullSet(), isReal(), Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, and THROW_ASSERT.

Here is the call graph for this function:

◆ Uge()

RangeRef Range::Uge ( const RangeConstRef &  other,
bw_t  bw 
) const

Definition at line 1796 of file Range.cpp.

References getUnsignedMax(), getUnsignedMin(), isAnti(), isReal(), Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, and THROW_ASSERT.

Here is the call graph for this function:

◆ Ugt()

RangeRef Range::Ugt ( const RangeConstRef &  other,
bw_t  bw 
) const

Definition at line 1770 of file Range.cpp.

References getUnsignedMax(), getUnsignedMin(), isAnti(), isReal(), Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, and THROW_ASSERT.

Referenced by UMax().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ule()

RangeRef Range::Ule ( const RangeConstRef &  other,
bw_t  bw 
) const

Definition at line 1848 of file Range.cpp.

References getUnsignedMax(), getUnsignedMin(), isAnti(), isReal(), Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, and THROW_ASSERT.

Here is the call graph for this function:

◆ Ult()

RangeRef Range::Ult ( const RangeConstRef &  other,
bw_t  bw 
) const

Definition at line 1822 of file Range.cpp.

References getUnsignedMax(), getUnsignedMin(), isAnti(), isReal(), Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, and THROW_ASSERT.

Referenced by UMin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UMax()

RangeRef Range::UMax ( const RangeConstRef &  other) const

Definition at line 2038 of file Range.cpp.

References bw, clone(), getUnsignedMax(), getUnsignedMin(), isAnti(), isReal(), max, min, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, THROW_ASSERT, and Ugt().

Here is the call graph for this function:

◆ UMin()

RangeRef Range::UMin ( const RangeConstRef &  other) const

Definition at line 2018 of file Range.cpp.

References bw, clone(), getUnsignedMax(), getUnsignedMin(), isAnti(), isReal(), max, min, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, THROW_ASSERT, and Ult().

Here is the call graph for this function:

◆ unionWith()

RangeRef Range::unionWith ( const RangeConstRef &  other) const
virtual

Reimplemented in RealRange.

Definition at line 2356 of file Range.cpp.

References Anti, bw, clone(), getAnti(), getLower(), getUpper(), isAnti(), isEmpty(), isReal(), isUnknown(), Max, Min, PRINT_MSG, Range(), Regular, THROW_ASSERT, and THROW_UNREACHABLE.

Here is the call graph for this function:

◆ urem()

RangeRef Range::urem ( const RangeConstRef &  other) const

Definition at line 1177 of file Range.cpp.

References bw, Empty, getUnsignedMax(), getUnsignedMin(), isAnti(), isReal(), Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, and THROW_ASSERT.

Here is the call graph for this function:

◆ usat_add()

RangeRef Range::usat_add ( const RangeConstRef &  other) const

Definition at line 770 of file Range.cpp.

References Anti, bw, getLower(), APInt::getMaxValue(), getSpan(), getUpper(), isAnti(), isFullSet(), isReal(), l, max, Max, Min, min, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, THROW_ASSERT, and u.

Here is the call graph for this function:

◆ usat_sub()

RangeRef Range::usat_sub ( const RangeConstRef &  other) const

Definition at line 954 of file Range.cpp.

References bw, clone(), getLower(), APInt::getMaxValue(), getSpan(), getUpper(), isAnti(), isFullSet(), isReal(), l, max, Max, Min, min, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, THROW_ASSERT, and u.

Here is the call graph for this function:

◆ Xor()

RangeRef Range::Xor ( const RangeConstRef &  other) const

Definition at line 1658 of file Range.cpp.

References bw, clone(), getLower(), getUpper(), isAnti(), isReal(), Max, Min, Range(), Regular, RETURN_EMPTY_ON_EMPTY, RETURN_UNKNOWN_ON_UNKNOWN, sub(), and THROW_ASSERT.

Here is the call graph for this function:

◆ zextOrTrunc()

RangeRef Range::zextOrTrunc ( bw_t  bitwidth) const

Definition at line 2209 of file Range.cpp.

References bw, Empty, APInt::getMaxValue(), getSignedMax(), getSignedMin(), getUnsignedMax(), isAnti(), isEmpty(), isReal(), isUnknown(), Range(), Regular, THROW_ASSERT, truncate(), u, and Unknown.

Referenced by RealRange::Eq().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ bw

bw_t Range::bw
private

◆ l

APInt Range::l
private

◆ Max

const APInt Range::Max = APInt::getSignedMaxValue(Range::max_digits)
static

◆ max_digits

const bw_t Range::max_digits = static_cast<bw_t>(std::numeric_limits<APInt::number>::digits)
static

◆ Min

const APInt Range::Min = APInt::getSignedMinValue(Range::max_digits)
static

◆ MinDelta

const APInt Range::MinDelta
static

Definition at line 164 of file Range.hpp.

Referenced by getUnsignedMax(), getUnsignedMin(), makeSatisfyingCmpRegion(), and normalizeRange().

◆ type

RangeType Range::type
private

◆ u

APInt Range::u
private

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

Generated on Mon Feb 12 2024 13:04:01 for PandA-2024.02 by doxygen 1.8.13