LLVM 17.0.0git
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
llvm::AddressRanges Class Reference

The AddressRanges class helps normalize address range collections. More...

#include "llvm/ADT/AddressRanges.h"

Inheritance diagram for llvm::AddressRanges:
Inheritance graph
Collaboration diagram for llvm::AddressRanges:
Collaboration graph

Public Member Functions

void clear ()
bool empty () const
bool contains (uint64_t Addr) const
bool contains (AddressRange Range) const
std::optional< AddressRangegetRangeThatContains (uint64_t Addr) const
Collection::const_iterator insert (AddressRange Range)
void reserve (size_t Capacity)
size_t size () const
bool operator== (const AddressRanges &RHS) const
const AddressRangeoperator[] (size_t i) const
Collection::const_iterator begin () const
Collection::const_iterator end () const

Protected Types

using Collection = SmallVector< AddressRange >

Protected Member Functions

Collection::const_iterator find (uint64_t Addr) const
Collection::const_iterator find (AddressRange Range) const

Protected Attributes

Collection Ranges

Detailed Description

The AddressRanges class helps normalize address range collections.

This class keeps a sorted vector of AddressRange objects and can perform insertions and searches efficiently. The address ranges are always sorted and never contain any invalid or empty address ranges. Intersecting([100,200), [150,300)) and adjacent([100,200), [200,300)) address ranges are combined during insertion.

Definition at line 54 of file AddressRanges.h.

Member Typedef Documentation

◆ Collection

Definition at line 56 of file AddressRanges.h.

Member Function Documentation

◆ begin()

Collection::const_iterator llvm::AddressRanges::begin ( ) const

◆ clear()

void llvm::AddressRanges::clear ( )

Definition at line 60 of file AddressRanges.h.

References llvm::SmallVectorImpl< T >::clear(), and Ranges.

Referenced by llvm::gsym::InlineInfo::clear().

◆ contains() [1/2]

bool llvm::AddressRanges::contains ( AddressRange  Range) const

◆ contains() [2/2]

bool llvm::AddressRanges::contains ( uint64_t  Addr) const

◆ empty()

bool llvm::AddressRanges::empty ( ) const

◆ end()

Collection::const_iterator llvm::AddressRanges::end ( ) const

◆ find() [1/2]

AddressRanges::Collection::const_iterator AddressRanges::find ( AddressRange  Range) const

◆ find() [2/2]

AddressRanges::Collection::const_iterator AddressRanges::find ( uint64_t  Addr) const

◆ getRangeThatContains()

std::optional< AddressRange > llvm::AddressRanges::getRangeThatContains ( uint64_t  Addr) const

◆ insert()

AddressRanges::Collection::const_iterator AddressRanges::insert ( AddressRange  Range)

◆ operator==()

bool llvm::AddressRanges::operator== ( const AddressRanges RHS) const

Definition at line 76 of file AddressRanges.h.

References Ranges, and RHS.

◆ operator[]()

const AddressRange & llvm::AddressRanges::operator[] ( size_t  i) const

Definition at line 79 of file AddressRanges.h.

References assert(), Ranges, and llvm::SmallVectorBase< Size_T >::size().

◆ reserve()

void llvm::AddressRanges::reserve ( size_t  Capacity)

Definition at line 74 of file AddressRanges.h.

References Ranges, and llvm::SmallVectorImpl< T >::reserve().

◆ size()

size_t llvm::AddressRanges::size ( ) const

Member Data Documentation

◆ Ranges

Collection llvm::AddressRanges::Ranges

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