LLVM: llvm::dwarf::CFIProgram Class Reference (original) (raw)

Represent a sequence of Call Frame Information instructions that, when read in order, construct a table mapping PC to frame state. More...

#include "[llvm/DebugInfo/DWARF/LowLevel/DWARFCFIProgram.h](DWARFCFIProgram%5F8h%5Fsource.html)"

Classes
struct Instruction
An instruction consists of a DWARF CFI opcode and an optional sequence of operands. More...
Public Types
enum OperandType { OT_Unset, OT_None, OT_Address, OT_Offset, OT_FactoredCodeOffset, OT_SignedFactDataOffset, OT_UnsignedFactDataOffset, OT_Register, OT_AddressSpace, OT_Expression }
Types of operands to CFI instructions In DWARF, this type is implicitly tied to a CFI instruction opcode and thus this type doesn't need to be explicitly written to the file (this is not a DWARF encoding). More...
typedef SmallVector< uint64_t, MaxOperands > Operands
using InstrList = std::vector<Instruction>
using iterator = InstrList::iterator
using const_iterator = InstrList::const_iterator
Public Member Functions
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
unsigned size () const
bool empty () const
uint64_t codeAlign () const
int64_t dataAlign () const
Triple::ArchType triple () const
CFIProgram (uint64_t CodeAlignmentFactor, int64_t DataAlignmentFactor, Triple::ArchType Arch)
template<typename T>
Error parse (DWARFDataExtractorBase< T > &Data, uint64_t *Offset, uint64_t EndOffset)
Parse and store a sequence of CFI instructions from Data, starting at *Offset and ending at EndOffset.
void addInstruction (const Instruction &I)
LLVM_ABI StringRef callFrameString (unsigned Opcode) const
Get a DWARF CFI call frame string for the given DW_CFA opcode.
void addInstruction (uint8_t Opcode)
Convenience method to add a new instruction with the given opcode.
void addInstruction (uint8_t Opcode, uint64_t Operand1)
Add a new single-operand instruction.
void addInstruction (uint8_t Opcode, uint64_t Operand1, uint64_t Operand2)
Add a new instruction that has two operands.
void addInstruction (uint8_t Opcode, uint64_t Operand1, uint64_t Operand2, uint64_t Operand3)
Add a new instruction that has three operands.
Static Public Member Functions
static LLVM_ABI const char * operandTypeString (OperandType OT)
Get the OperandType as a "const char *".
static LLVM_ABI ArrayRef< OperandType[MaxOperands]> getOperandTypes ()
Retrieve the array describing the types of operands according to the enum above.
Static Public Attributes
static constexpr size_t MaxOperands = 3

Represent a sequence of Call Frame Information instructions that, when read in order, construct a table mapping PC to frame state.

This can also be referred to as "CFI rules" in DWARF literature to avoid confusion with computer programs in the broader sense, and in this context each instruction would be a rule to establish the mapping. Refer to pg. 172 in the DWARF5 manual, "6.4.1 Structure of Call Frame Information".

Definition at line 32 of file DWARFCFIProgram.h.

const_iterator

using llvm::dwarf::CFIProgram::const_iterator = InstrList::const_iterator

InstrList

iterator

using llvm::dwarf::CFIProgram::iterator = InstrList::iterator

Operands

OperandType

Types of operands to CFI instructions In DWARF, this type is implicitly tied to a CFI instruction opcode and thus this type doesn't need to be explicitly written to the file (this is not a DWARF encoding).

The relationship of instrs to operand types can be obtained from getOperandTypes() and is only used to simplify instruction printing and error messages.

Enumerator
OT_Unset
OT_None
OT_Address
OT_Offset
OT_FactoredCodeOffset
OT_SignedFactDataOffset
OT_UnsignedFactDataOffset
OT_Register
OT_AddressSpace
OT_Expression

Definition at line 235 of file DWARFCFIProgram.h.

llvm::dwarf::CFIProgram::CFIProgram ( uint64_t CodeAlignmentFactor, int64_t DataAlignmentFactor, Triple::ArchType Arch ) inline

addInstruction() [1/5]

addInstruction() [2/5]

void llvm::dwarf::CFIProgram::addInstruction ( uint8_t Opcode) inline

Convenience method to add a new instruction with the given opcode.

Definition at line 256 of file DWARFCFIProgram.h.

addInstruction() [3/5]

void llvm::dwarf::CFIProgram::addInstruction ( uint8_t Opcode, uint64_t Operand1 ) inline

addInstruction() [4/5]

addInstruction() [5/5]

begin() [1/2]

iterator llvm::dwarf::CFIProgram::begin ( ) inline

begin() [2/2]

const_iterator llvm::dwarf::CFIProgram::begin ( ) const inline

callFrameString()

codeAlign()

uint64_t llvm::dwarf::CFIProgram::codeAlign ( ) const inline

dataAlign()

int64_t llvm::dwarf::CFIProgram::dataAlign ( ) const inline

empty()

bool llvm::dwarf::CFIProgram::empty ( ) const inline

end() [1/2]

iterator llvm::dwarf::CFIProgram::end ( ) inline

end() [2/2]

const_iterator llvm::dwarf::CFIProgram::end ( ) const inline

getOperandTypes()

Retrieve the array describing the types of operands according to the enum above.

This is indexed by opcode.

Definition at line 144 of file DWARFCFIProgram.cpp.

References llvm::ArrayRef(), DECLARE_OP0, DECLARE_OP1, DECLARE_OP2, DECLARE_OP3, MaxOperands, OT_Address, OT_AddressSpace, OT_Expression, OT_FactoredCodeOffset, OT_Offset, OT_Register, OT_SignedFactDataOffset, and OT_UnsignedFactDataOffset.

Referenced by llvm::dwarf::CFIProgram::Instruction::getOperandAsSigned(), and llvm::dwarf::CFIProgram::Instruction::getOperandAsUnsigned().

operandTypeString()

Get the OperandType as a "const char *".

Definition at line 25 of file DWARFCFIProgram.cpp.

References ENUM_TO_CSTR, OT_Address, OT_AddressSpace, OT_Expression, OT_FactoredCodeOffset, OT_None, OT_Offset, OT_Register, OT_SignedFactDataOffset, OT_Unset, and OT_UnsignedFactDataOffset.

Referenced by llvm::dwarf::CFIProgram::Instruction::getOperandAsSigned(), and llvm::dwarf::CFIProgram::Instruction::getOperandAsUnsigned().

parse()

size()

unsigned llvm::dwarf::CFIProgram::size ( ) const inline

triple()

MaxOperands

size_t llvm::dwarf::CFIProgram::MaxOperands = 3 staticconstexpr

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