LLVM
13.0.0git
|
The AddressRanges class helps normalize address range collections. More...
#include "llvm/DebugInfo/GSYM/Range.h"
Public Member Functions | |
void | clear () |
bool | empty () const |
bool | contains (uint64_t Addr) const |
bool | contains (AddressRange Range) const |
Optional< AddressRange > | getRangeThatContains (uint64_t Addr) const |
void | insert (AddressRange Range) |
size_t | size () const |
bool | operator== (const AddressRanges &RHS) const |
const AddressRange & | operator[] (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 |
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.
|
protected |
|
inline |
|
inline |
Definition at line 89 of file Range.h.
References Ranges.
Referenced by llvm::gsym::InlineInfo::clear(), and decode().
bool AddressRanges::contains | ( | AddressRange | Range | ) | const |
Definition at line 45 of file Range.cpp.
References llvm::gsym::AddressRange::End, llvm::partition_point(), Ranges, and llvm::gsym::AddressRange::size().
bool AddressRanges::contains | ( | uint64_t | Addr | ) | const |
Definition at line 38 of file Range.cpp.
References Addr, llvm::partition_point(), and Ranges.
Referenced by llvm::gsym::InlineInfo::encode(), getInlineStackHelper(), and llvm::gsym::GsymCreator::hasFunctionInfoForAddress().
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::Data, Offset, and Ranges.
|
inline |
Definition at line 90 of file Range.h.
References Ranges.
Referenced by llvm::gsym::InlineInfo::isValid(), and parseInlineInfo().
void AddressRanges::encode | ( | FileWriter & | O, |
uint64_t | BaseAddr | ||
) | const |
Definition at line 95 of file Range.cpp.
References llvm::RISCVFenceField::O, and Ranges.
Referenced by llvm::gsym::InlineInfo::encode().
|
inline |
Optional< AddressRange > AddressRanges::getRangeThatContains | ( | uint64_t | Addr | ) | const |
Definition at line 57 of file Range.cpp.
References Addr, llvm::None, llvm::partition_point(), and Ranges.
void AddressRanges::insert | ( | AddressRange | Range | ) |
Definition at line 20 of file Range.cpp.
References llvm::gsym::AddressRange::End, llvm::max(), Ranges, llvm::gsym::AddressRange::size(), llvm::gsym::AddressRange::Start, and llvm::upper_bound().
Referenced by llvm::gsym::GsymCreator::addFunctionInfo(), and parseInlineInfo().
|
inline |
|
inline |
|
inline |
|
static |
Skip an address range object in the specified data a the specified offset.
Data | The binary stream to read the data from. |
Offset | The byte offset within Data. |
Definition at line 119 of file Range.cpp.
References llvm::Data, I, Offset, and llvm::gsym::AddressRange::skip().
Referenced by skip().
|
protected |
Definition at line 87 of file Range.h.
Referenced by begin(), clear(), contains(), decode(), empty(), encode(), end(), getRangeThatContains(), insert(), operator==(), operator[](), and size().