LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::ConstantRangeList Class Reference

This class represents a list of constant ranges. More...

#include "llvm/IR/ConstantRangeList.h"

Public Member Functions

 ConstantRangeList ()=default
 
 ConstantRangeList (ArrayRef< ConstantRange > RangesRef)
 
ArrayRef< ConstantRangerangesRef () const
 
SmallVectorImpl< ConstantRange >::iterator begin ()
 
SmallVectorImpl< ConstantRange >::iterator end ()
 
SmallVectorImpl< ConstantRange >::const_iterator begin () const
 
SmallVectorImpl< ConstantRange >::const_iterator end () const
 
ConstantRange getRange (unsigned i) const
 
bool empty () const
 Return true if this list contains no members.
 
uint32_t getBitWidth () const
 Get the bit width of this ConstantRangeList.
 
size_t size () const
 Return the number of ranges in this ConstantRangeList.
 
void insert (const ConstantRange &NewRange)
 Insert a new range to Ranges and keep the list ordered.
 
void insert (int64_t Lower, int64_t Upper)
 
void subtract (const ConstantRange &SubRange)
 
ConstantRangeList unionWith (const ConstantRangeList &CRL) const
 Return the range list that results from the union of this ConstantRangeList with another ConstantRangeList, "CRL".
 
ConstantRangeList intersectWith (const ConstantRangeList &CRL) const
 Return the range list that results from the intersection of this ConstantRangeList with another ConstantRangeList, "CRL".
 
bool operator== (const ConstantRangeList &CRL) const
 Return true if this range list is equal to another range list.
 
bool operator!= (const ConstantRangeList &CRL) const
 
void print (raw_ostream &OS) const
 Print out the ranges to a stream.
 
void dump () const
 

Static Public Member Functions

static bool isOrderedRanges (ArrayRef< ConstantRange > RangesRef)
 
static std::optional< ConstantRangeListgetConstantRangeList (ArrayRef< ConstantRange > RangesRef)
 

Detailed Description

This class represents a list of constant ranges.

Definition at line 30 of file ConstantRangeList.h.

Constructor & Destructor Documentation

◆ ConstantRangeList() [1/2]

llvm::ConstantRangeList::ConstantRangeList ( )
default

Referenced by getConstantRangeList().

◆ ConstantRangeList() [2/2]

llvm::ConstantRangeList::ConstantRangeList ( ArrayRef< ConstantRange RangesRef)
inline

Definition at line 35 of file ConstantRangeList.h.

References assert(), and getBitWidth().

Member Function Documentation

◆ begin() [1/2]

SmallVectorImpl< ConstantRange >::iterator llvm::ConstantRangeList::begin ( )
inline

Definition at line 49 of file ConstantRangeList.h.

◆ begin() [2/2]

SmallVectorImpl< ConstantRange >::const_iterator llvm::ConstantRangeList::begin ( ) const
inline

Definition at line 51 of file ConstantRangeList.h.

◆ dump()

LLVM_DUMP_METHOD void ConstantRangeList::dump ( ) const

Definition at line 239 of file ConstantRangeList.cpp.

References llvm::dbgs(), and print().

◆ empty()

bool llvm::ConstantRangeList::empty ( ) const
inline

Return true if this list contains no members.

Definition at line 60 of file ConstantRangeList.h.

Referenced by insert(), intersectWith(), subtract(), and unionWith().

◆ end() [1/2]

SmallVectorImpl< ConstantRange >::iterator llvm::ConstantRangeList::end ( )
inline

Definition at line 50 of file ConstantRangeList.h.

◆ end() [2/2]

SmallVectorImpl< ConstantRange >::const_iterator llvm::ConstantRangeList::end ( ) const
inline

Definition at line 54 of file ConstantRangeList.h.

◆ getBitWidth()

uint32_t llvm::ConstantRangeList::getBitWidth ( ) const
inline

Get the bit width of this ConstantRangeList.

Definition at line 63 of file ConstantRangeList.h.

Referenced by insert(), intersectWith(), subtract(), and unionWith().

◆ getConstantRangeList()

std::optional< ConstantRangeList > ConstantRangeList::getConstantRangeList ( ArrayRef< ConstantRange RangesRef)
static

Definition at line 31 of file ConstantRangeList.cpp.

References ConstantRangeList(), and isOrderedRanges().

◆ getRange()

ConstantRange llvm::ConstantRangeList::getRange ( unsigned  i) const
inline

Definition at line 57 of file ConstantRangeList.h.

◆ insert() [1/2]

void ConstantRangeList::insert ( const ConstantRange NewRange)

◆ insert() [2/2]

void llvm::ConstantRangeList::insert ( int64_t  Lower,
int64_t  Upper 
)
inline

Definition at line 70 of file ConstantRangeList.h.

References llvm::Upper.

◆ intersectWith()

ConstantRangeList ConstantRangeList::intersectWith ( const ConstantRangeList CRL) const

Return the range list that results from the intersection of this ConstantRangeList with another ConstantRangeList, "CRL".

Definition at line 194 of file ConstantRangeList.cpp.

References assert(), empty(), End, getBitWidth(), llvm::ConstantRange::getLower(), llvm::ConstantRange::getUpper(), Range, size(), llvm::APInt::slt(), llvm::APIntOps::smax(), and llvm::APIntOps::smin().

◆ isOrderedRanges()

bool ConstantRangeList::isOrderedRanges ( ArrayRef< ConstantRange RangesRef)
static

◆ operator!=()

bool llvm::ConstantRangeList::operator!= ( const ConstantRangeList CRL) const
inline

Definition at line 89 of file ConstantRangeList.h.

References llvm::operator==().

◆ operator==()

bool llvm::ConstantRangeList::operator== ( const ConstantRangeList CRL) const
inline

Return true if this range list is equal to another range list.

Definition at line 86 of file ConstantRangeList.h.

◆ print()

void ConstantRangeList::print ( raw_ostream OS) const

Print out the ranges to a stream.

Definition at line 232 of file ConstantRangeList.cpp.

References llvm::ConstantRange::getLower(), llvm::ConstantRange::getUpper(), llvm::interleaveComma(), and OS.

Referenced by dump(), and llvm::Attribute::getAsString().

◆ rangesRef()

ArrayRef< ConstantRange > llvm::ConstantRangeList::rangesRef ( ) const
inline

Definition at line 48 of file ConstantRangeList.h.

Referenced by llvm::AttrBuilder::addInitializesAttr().

◆ size()

size_t llvm::ConstantRangeList::size ( ) const
inline

Return the number of ranges in this ConstantRangeList.

Definition at line 66 of file ConstantRangeList.h.

Referenced by intersectWith(), and unionWith().

◆ subtract()

void ConstantRangeList::subtract ( const ConstantRange SubRange)

◆ unionWith()

ConstantRangeList ConstantRangeList::unionWith ( const ConstantRangeList CRL) const

Return the range list that results from the union of this ConstantRangeList with another ConstantRangeList, "CRL".

Definition at line 144 of file ConstantRangeList.cpp.

References assert(), empty(), getBitWidth(), llvm::ConstantRange::getLower(), llvm::ConstantRange::getUpper(), size(), llvm::APInt::slt(), and llvm::APIntOps::smax().


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