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

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

#include "llvm/ADT/AddressRanges.h"

Collaboration diagram for llvm::AddressRanges:
Collaboration graph
[legend]

Public Member Functions

void clear ()
 
bool empty () const
 
bool contains (uint64_t Addr) const
 
bool contains (AddressRange Range) const
 
Optional< AddressRangegetRangeThatContains (uint64_t Addr) const
 
void 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 = std::vector< AddressRange >
 

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 address ranges are combined during insertion.

Definition at line 52 of file AddressRanges.h.

Member Typedef Documentation

◆ Collection

using llvm::AddressRanges::Collection = std::vector<AddressRange>
protected

Definition at line 54 of file AddressRanges.h.

Member Function Documentation

◆ begin()

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

Definition at line 73 of file AddressRanges.h.

References Ranges.

◆ clear()

void llvm::AddressRanges::clear ( )
inline

Definition at line 58 of file AddressRanges.h.

References Ranges.

Referenced by llvm::gsym::InlineInfo::clear(), and llvm::gsym::decodeRanges().

◆ contains() [1/2]

bool AddressRanges::contains ( AddressRange  Range) const

◆ contains() [2/2]

bool AddressRanges::contains ( uint64_t  Addr) const

◆ empty()

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

Definition at line 59 of file AddressRanges.h.

References Ranges.

Referenced by llvm::gsym::encodeRanges(), llvm::gsym::InlineInfo::isValid(), and parseInlineInfo().

◆ end()

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

Definition at line 74 of file AddressRanges.h.

References Ranges.

Referenced by insert().

◆ getRangeThatContains()

Optional< AddressRange > AddressRanges::getRangeThatContains ( uint64_t  Addr) const

Definition at line 52 of file AddressRanges.cpp.

References Addr, llvm::None, llvm::partition_point(), and Ranges.

◆ insert()

void AddressRanges::insert ( AddressRange  Range)

◆ operator==()

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

Definition at line 66 of file AddressRanges.h.

References Ranges, and RHS.

◆ operator[]()

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

Definition at line 69 of file AddressRanges.h.

References assert(), i, and Ranges.

◆ reserve()

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

Definition at line 64 of file AddressRanges.h.

References Ranges.

Referenced by llvm::gsym::decodeRanges().

◆ size()

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

Definition at line 65 of file AddressRanges.h.

References Ranges.

Referenced by llvm::gsym::encodeRanges(), and llvm::operator<<().

Member Data Documentation

◆ Ranges

Collection llvm::AddressRanges::Ranges
protected

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