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

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

#include "llvm/DebugInfo/GSYM/Range.h"

Collaboration diagram for llvm::gsym::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)
 
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
 
void decode (DataExtractor &Data, uint64_t BaseAddr, uint64_t &Offset)
 Address ranges are decoded and encoded to be relative to a base address. More...
 
void encode (FileWriter &O, uint64_t BaseAddr) const
 

Static Public Member Functions

static uint64_t skip (DataExtractor &Data, uint64_t &Offset)
 Skip an address range object in the specified data a the specified offset. More...
 

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. This allows us to emit address ranges into the GSYM file efficiently. Intersecting address ranges are combined during insertion so that we can emit the most compact representation for address ranges when writing to disk.

Definition at line 84 of file Range.h.

Member Typedef Documentation

◆ Collection

Definition at line 86 of file Range.h.

Member Function Documentation

◆ begin()

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

Definition at line 103 of file Range.h.

◆ clear()

void llvm::gsym::AddressRanges::clear ( )
inline

Definition at line 89 of file Range.h.

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

◆ contains() [1/2]

bool AddressRanges::contains ( uint64_t  Addr) const

◆ contains() [2/2]

bool AddressRanges::contains ( AddressRange  Range) const

◆ decode()

void AddressRanges::decode ( DataExtractor Data,
uint64_t  BaseAddr,
uint64_t &  Offset 
)

Address ranges are decoded and encoded to be relative to a base address.

See the AddressRange comment for the encode and decode methods for full details.

Definition at line 103 of file Range.cpp.

References clear(), llvm::DataExtractor::getULEB128(), and Ranges.

Referenced by decode().

◆ empty()

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

◆ encode()

void AddressRanges::encode ( FileWriter O,
uint64_t  BaseAddr 
) const

Definition at line 95 of file Range.cpp.

References Ranges, and llvm::gsym::FileWriter::writeULEB().

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

◆ end()

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

◆ getRangeThatContains()

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

Definition at line 57 of file Range.cpp.

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

◆ insert()

void AddressRanges::insert ( AddressRange  Range)

◆ operator==()

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

Definition at line 96 of file Range.h.

References Ranges.

◆ operator[]()

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

Definition at line 99 of file Range.h.

References assert().

◆ size()

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

Definition at line 95 of file Range.h.

Referenced by llvm::gsym::operator<<().

◆ skip()

uint64_t AddressRanges::skip ( DataExtractor Data,
uint64_t &  Offset 
)
static

Skip an address range object in the specified data a the specified offset.

Parameters
DataThe binary stream to read the data from.
OffsetThe byte offset within Data.
Returns
The number of address ranges that were skipped.

Definition at line 119 of file Range.cpp.

References llvm::DataExtractor::getULEB128(), I, and llvm::gsym::AddressRange::skip().

Referenced by skip().

Member Data Documentation

◆ Ranges

Collection llvm::gsym::AddressRanges::Ranges
protected

Definition at line 87 of file Range.h.

Referenced by contains(), decode(), encode(), getRangeThatContains(), insert(), and operator==().


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