LLVM  14.0.0git
Public Member Functions | List of all members
llvm::dwarf::RegisterLocations Class Reference

A class that can track all registers with locations in a UnwindRow object. More...

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

Public Member Functions

Optional< UnwindLocationgetRegisterLocation (uint32_t RegNum) const
 Return the location for the register in RegNum if there is a location. More...
 
void setRegisterLocation (uint32_t RegNum, const UnwindLocation &Location)
 Set the location for the register in RegNum to Location. More...
 
void removeRegisterLocation (uint32_t RegNum)
 Removes any rule for the register in RegNum. More...
 
void dump (raw_ostream &OS, const MCRegisterInfo *MRI, bool IsEH) const
 Dump all registers + locations that are currently defined in this object. More...
 
bool hasLocations () const
 Returns true if we have any register locations in this object. More...
 
size_t size () const
 
bool operator== (const RegisterLocations &RHS) const
 

Detailed Description

A class that can track all registers with locations in a UnwindRow object.

Register locations use a map where the key is the register number and the the value is a UnwindLocation.

The register maps are put into a class so that all register locations can be copied when parsing the unwind opcodes DW_CFA_remember_state and DW_CFA_restore_state.

Definition at line 178 of file DWARFDebugFrame.h.

Member Function Documentation

◆ dump()

void RegisterLocations::dump ( raw_ostream OS,
const MCRegisterInfo MRI,
bool  IsEH 
) const

Dump all registers + locations that are currently defined in this object.

Parameters
OSthe stream to use for output.
MRIregister information that helps emit register names insteead of raw register numbers.
IsEHtrue if the DWARF Call Frame Information is from .eh_frame instead of from .debug_frame. This is needed for register number conversion because some register numbers differ between the two sections for certain architectures like x86.

Definition at line 152 of file DWARFDebugFrame.cpp.

References First, MRI, and printRegister().

Referenced by llvm::dwarf::UnwindRow::dump(), and llvm::dwarf::operator<<().

◆ getRegisterLocation()

Optional<UnwindLocation> llvm::dwarf::RegisterLocations::getRegisterLocation ( uint32_t  RegNum) const
inline

Return the location for the register in RegNum if there is a location.

Parameters
RegNumthe register number to find a location for.
Returns
A location if one is available for RegNum, or llvm::None otherwise.

Definition at line 188 of file DWARFDebugFrame.h.

References llvm::None.

◆ hasLocations()

bool llvm::dwarf::RegisterLocations::hasLocations ( ) const
inline

Returns true if we have any register locations in this object.

Definition at line 224 of file DWARFDebugFrame.h.

Referenced by llvm::dwarf::UnwindRow::dump().

◆ operator==()

bool llvm::dwarf::RegisterLocations::operator== ( const RegisterLocations RHS) const
inline

Definition at line 228 of file DWARFDebugFrame.h.

◆ removeRegisterLocation()

void llvm::dwarf::RegisterLocations::removeRegisterLocation ( uint32_t  RegNum)
inline

Removes any rule for the register in RegNum.

Parameters
RegNumthe register number to remove the location for.

Definition at line 208 of file DWARFDebugFrame.h.

◆ setRegisterLocation()

void llvm::dwarf::RegisterLocations::setRegisterLocation ( uint32_t  RegNum,
const UnwindLocation Location 
)
inline

Set the location for the register in RegNum to Location.

Parameters
RegNumthe register number to set the location for.
Locationthe UnwindLocation that describes how to unwind the value.

Definition at line 200 of file DWARFDebugFrame.h.

◆ size()

size_t llvm::dwarf::RegisterLocations::size ( ) const
inline

Definition at line 226 of file DWARFDebugFrame.h.


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