LLVM 22.0.0git
llvm::ARM::WinEH::RuntimeFunction Class Reference

RuntimeFunction - An entry in the table of procedure data (.pdata) More...

#include "llvm/Support/ARMWinEH.h"

Public Member Functions

 RuntimeFunction (const support::ulittle32_t *Data)
 RuntimeFunction (const support::ulittle32_t BeginAddress, const support::ulittle32_t UnwindData)
RuntimeFunctionFlag Flag () const
uint32_t ExceptionInformationRVA () const
uint32_t PackedUnwindData () const
uint32_t FunctionLength () const
ReturnType Ret () const
bool H () const
uint8_t Reg () const
bool R () const
bool L () const
bool C () const
uint16_t StackAdjust () const

Public Attributes

const support::ulittle32_t BeginAddress
const support::ulittle32_t UnwindData

Detailed Description

RuntimeFunction - An entry in the table of procedure data (.pdata)

This is ARM specific, but the Function Start RVA, Flag and ExceptionInformationRVA fields work identically for ARM64.

3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +------------------------------------------------------------—+ | Function Start RVA | +----------------—+-+-+-+--—+-+—+------------------—+—+ | Stack Adjust |C|L|R| Reg |H|Ret| Function Length |Flg| +----------------—+-+-+-+--—+-+—+------------------—+—+

Flag : 2-bit field with the following meanings:

  • 00 = packed unwind data not used; reamining bits point to .xdata record
  • 01 = packed unwind data
  • 10 = packed unwind data, function assumed to have no prologue; useful for function fragments that are discontiguous with the start of the function
  • 11 = reserved Function Length : 11-bit field providing the length of the entire function in bytes, divided by 2; if the function is greater than 4KB, a full .xdata record must be used instead Ret : 2-bit field indicating how the function returns
  • 00 = return via pop {pc} (the L bit must be set)
  • 01 = return via 16-bit branch
  • 10 = return via 32-bit branch
  • 11 = no epilogue; useful for function fragments that may only contain a prologue but the epilogue is elsewhere H : 1-bit flag indicating whether the function "homes" the integer parameter registers (r0-r3), allocating 16-bytes on the stack Reg : 3-bit field indicating the index of the last saved non-volatile register. If the R bit is set to 0, then only integer registers are saved (r4-rN, where N is 4 + Reg). If the R bit is set to 1, then only floating-point registers are being saved (d8-dN, where N is 8 + Reg). The special case of the R bit being set to 1 and Reg equal to 7 indicates that no registers are saved. R : 1-bit flag indicating whether the non-volatile registers are integer or floating-point. 0 indicates integer, 1 indicates floating-point. The special case of the R-flag being set and Reg being set to 7 indicates that no non-volatile registers are saved. L : 1-bit flag indicating whether the function saves/restores the link register (LR) C : 1-bit flag indicating whether the function includes extra instructions to setup a frame chain for fast walking. If this flag is set, r11 is implicitly added to the list of saved non-volatile integer registers. Stack Adjust : 10-bit field indicating the number of bytes of stack that are allocated for this function. Only values between 0x000 and 0x3f3 can be directly encoded. If the value is 0x3f4 or greater, then the low 4 bits have special meaning as follows:
    • Bit 0-1 indicate the number of words' of adjustment (1-4), minus 1
    • Bit 2 indicates if the prologue combined adjustment into push
    • Bit 3 indicates if the epilogue combined adjustment into pop

RESTRICTIONS:

  • IF C is SET:
    • L flag must be set since frame chaining requires r11 and lr
    • r11 must NOT be included in the set of registers described by Reg
  • IF Ret is 0:
    • L flag must be set

Definition at line 104 of file ARMWinEH.h.

Constructor & Destructor Documentation

◆ RuntimeFunction() [1/2]

llvm::ARM::WinEH::RuntimeFunction::RuntimeFunction ( const support::ulittle32_t * Data)
inline

Definition at line 109 of file ARMWinEH.h.

References BeginAddress, llvm::Data, and UnwindData.

◆ RuntimeFunction() [2/2]

llvm::ARM::WinEH::RuntimeFunction::RuntimeFunction ( const support::ulittle32_t BeginAddress,
const support::ulittle32_t UnwindData )
inline

Definition at line 112 of file ARMWinEH.h.

References BeginAddress, and UnwindData.

Member Function Documentation

◆ C()

bool llvm::ARM::WinEH::RuntimeFunction::C ( ) const
inline

◆ ExceptionInformationRVA()

uint32_t llvm::ARM::WinEH::RuntimeFunction::ExceptionInformationRVA ( ) const
inline

Definition at line 120 of file ARMWinEH.h.

References assert(), Flag(), llvm::ARM::WinEH::RFF_Unpacked, and UnwindData.

◆ Flag()

RuntimeFunctionFlag llvm::ARM::WinEH::RuntimeFunction::Flag ( ) const
inline

Definition at line 116 of file ARMWinEH.h.

References UnwindData.

Referenced by C(), ExceptionInformationRVA(), FunctionLength(), H(), L(), PackedUnwindData(), R(), Reg(), Ret(), and StackAdjust().

◆ FunctionLength()

uint32_t llvm::ARM::WinEH::RuntimeFunction::FunctionLength ( ) const
inline

◆ H()

bool llvm::ARM::WinEH::RuntimeFunction::H ( ) const
inline

◆ L()

bool llvm::ARM::WinEH::RuntimeFunction::L ( ) const
inline

◆ PackedUnwindData()

uint32_t llvm::ARM::WinEH::RuntimeFunction::PackedUnwindData ( ) const
inline

◆ R()

bool llvm::ARM::WinEH::RuntimeFunction::R ( ) const
inline

◆ Reg()

uint8_t llvm::ARM::WinEH::RuntimeFunction::Reg ( ) const
inline

◆ Ret()

ReturnType llvm::ARM::WinEH::RuntimeFunction::Ret ( ) const
inline

◆ StackAdjust()

Member Data Documentation

◆ BeginAddress

const support::ulittle32_t llvm::ARM::WinEH::RuntimeFunction::BeginAddress

Definition at line 106 of file ARMWinEH.h.

Referenced by RuntimeFunction(), and RuntimeFunction().

◆ UnwindData

const support::ulittle32_t llvm::ARM::WinEH::RuntimeFunction::UnwindData

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