LLVM 22.0.0git
llvm::DWARFAddressRange Struct Reference

#include "llvm/DebugInfo/DWARF/DWARFAddressRange.h"

Public Member Functions

 DWARFAddressRange ()=default
 DWARFAddressRange (uint64_t LowPC, uint64_t HighPC, uint64_t SectionIndex=object::SectionedAddress::UndefSection)
 Used for unit testing.
bool valid () const
 Returns true if LowPC is smaller or equal to HighPC.
bool intersects (const DWARFAddressRange &RHS) const
 Returns true if [LowPC, HighPC) intersects with [RHS.LowPC, RHS.HighPC).
bool merge (const DWARFAddressRange &RHS)
 Union two address ranges if they intersect.
LLVM_ABI void dump (raw_ostream &OS, uint32_t AddressSize, DIDumpOptions DumpOpts={}, const DWARFObject *Obj=nullptr) const

Public Attributes

uint64_t LowPC
uint64_t HighPC
uint64_t SectionIndex

Detailed Description

Definition at line 26 of file DWARFAddressRange.h.

Constructor & Destructor Documentation

◆ DWARFAddressRange() [1/2]

llvm::DWARFAddressRange::DWARFAddressRange ( )
default

Referenced by intersects(), and merge().

◆ DWARFAddressRange() [2/2]

llvm::DWARFAddressRange::DWARFAddressRange ( uint64_t LowPC,
uint64_t HighPC,
uint64_t SectionIndex = object::SectionedAddress::UndefSection )
inline

Used for unit testing.

Definition at line 34 of file DWARFAddressRange.h.

References HighPC, LowPC, SectionIndex, and llvm::object::SectionedAddress::UndefSection.

Member Function Documentation

◆ dump()

void DWARFAddressRange::dump ( raw_ostream & OS,
uint32_t AddressSize,
DIDumpOptions DumpOpts = {},
const DWARFObject * Obj = nullptr ) const

◆ intersects()

bool llvm::DWARFAddressRange::intersects ( const DWARFAddressRange & RHS) const
inline

Returns true if [LowPC, HighPC) intersects with [RHS.LowPC, RHS.HighPC).

Definition at line 44 of file DWARFAddressRange.h.

References assert(), DWARFAddressRange(), HighPC, LowPC, RHS, SectionIndex, and valid().

Referenced by merge().

◆ merge()

bool llvm::DWARFAddressRange::merge ( const DWARFAddressRange & RHS)
inline

Union two address ranges if they intersect.

This function will union two address ranges if they intersect by modifying this range to be the union of both ranges. If the two ranges don't intersect this range will be left alone.

Parameters
RHSAnother address range to combine with.
Returns
false if the ranges don't intersect, true if they do and the ranges were combined.

Definition at line 64 of file DWARFAddressRange.h.

References DWARFAddressRange(), HighPC, intersects(), LowPC, and RHS.

◆ valid()

bool llvm::DWARFAddressRange::valid ( ) const
inline

Returns true if LowPC is smaller or equal to HighPC.

This accounts for dead-stripped ranges.

Definition at line 41 of file DWARFAddressRange.h.

References HighPC, and LowPC.

Referenced by intersects().

Member Data Documentation

◆ HighPC

uint64_t llvm::DWARFAddressRange::HighPC

Definition at line 28 of file DWARFAddressRange.h.

Referenced by dump(), DWARFAddressRange(), intersects(), merge(), and valid().

◆ LowPC

uint64_t llvm::DWARFAddressRange::LowPC

◆ SectionIndex

uint64_t llvm::DWARFAddressRange::SectionIndex

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