LLVM 22.0.0git
|
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"
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 34 of file DWARFCFIProgram.h.
using llvm::dwarf::CFIProgram::const_iterator = InstrList::const_iterator |
Definition at line 59 of file DWARFCFIProgram.h.
using llvm::dwarf::CFIProgram::InstrList = std::vector<Instruction> |
Definition at line 57 of file DWARFCFIProgram.h.
using llvm::dwarf::CFIProgram::iterator = InstrList::iterator |
Definition at line 58 of file DWARFCFIProgram.h.
Definition at line 37 of file DWARFCFIProgram.h.
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 237 of file DWARFCFIProgram.h.
|
inline |
Definition at line 72 of file DWARFCFIProgram.h.
|
inline |
|
inline |
Convenience method to add a new instruction with the given opcode.
Definition at line 258 of file DWARFCFIProgram.h.
Add a new single-operand instruction.
Definition at line 263 of file DWARFCFIProgram.h.
|
inline |
Add a new instruction that has two operands.
Definition at line 269 of file DWARFCFIProgram.h.
|
inline |
Add a new instruction that has three operands.
Definition at line 276 of file DWARFCFIProgram.h.
|
inline |
Definition at line 61 of file DWARFCFIProgram.h.
|
inline |
Definition at line 62 of file DWARFCFIProgram.h.
Get a DWARF CFI call frame string for the given DW_CFA opcode.
Definition at line 21 of file DWARFCFIProgram.cpp.
References llvm::dwarf::CallFrameString().
Referenced by llvm::dwarf::parseRows().
|
inline |
Definition at line 68 of file DWARFCFIProgram.h.
Referenced by llvm::dwarf::CFIProgram::Instruction::getOperandAsUnsigned().
|
inline |
Definition at line 69 of file DWARFCFIProgram.h.
Referenced by llvm::dwarf::CFIProgram::Instruction::getOperandAsSigned().
|
inline |
Definition at line 67 of file DWARFCFIProgram.h.
Referenced by llvm::dwarf::createUnwindTable().
|
inline |
Definition at line 63 of file DWARFCFIProgram.h.
|
inline |
Definition at line 64 of file DWARFCFIProgram.h.
|
static |
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 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().
|
static |
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().
|
inline |
Parse and store a sequence of CFI instructions from Data, starting at *Offset and ending at EndOffset.
*Offset is updated to EndOffset upon successful parsing, or indicates the offset where a problem occurred in case an error is returned.
Definition at line 82 of file DWARFCFIProgram.h.
References addInstruction(), llvm::CallingConv::C, llvm::createStringError(), llvm::Data, llvm::illegal_byte_sequence, llvm_unreachable, and llvm::Offset.
|
inline |
Definition at line 66 of file DWARFCFIProgram.h.
|
inline |
Definition at line 70 of file DWARFCFIProgram.h.
Referenced by llvm::dwarf::parseRows().
|
staticconstexpr |
Definition at line 36 of file DWARFCFIProgram.h.
Referenced by llvm::dwarf::CFIProgram::Instruction::getOperandAsSigned(), llvm::dwarf::CFIProgram::Instruction::getOperandAsUnsigned(), getOperandTypes(), and printOperand().