LLVM 23.0.0git
llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize > Struct Template Reference

CRTP base for compact unwind traits classes. More...

#include "ExecutionEngine/JITLink/CompactUnwindSupport.h"

Inheritance diagram for llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize >:
[legend]

Static Public Member Functions

static uint32_t readPCRangeSize (ArrayRef< char > RecordContent)
static uint32_t readEncoding (ArrayRef< char > RecordContent)
static std::optional< uint32_tencodeDWARFOffset (size_t Delta)

Static Public Attributes

static constexpr size_t PointerSize = PtrSize
static constexpr size_t Size = 3 * PointerSize + 2 * 4
static constexpr size_t FnFieldOffset = 0
static constexpr size_t SizeFieldOffset = FnFieldOffset + PointerSize
static constexpr size_t EncodingFieldOffset = SizeFieldOffset + 4
static constexpr size_t PersonalityFieldOffset = EncodingFieldOffset + 4
static constexpr size_t LSDAFieldOffset

Detailed Description

template<typename CRTPImpl, size_t PtrSize>
struct llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize >

CRTP base for compact unwind traits classes.

Automatically provides derived constants.

Derived classes should implement the following properties and methods:

Endianness:

constexpr static endianness Endianness = ...;

Encoding mask for offset to DWARF section for records that need DWARF:

constexpr static uint32_t DWARFSectionOffsetMask = ...;

Predicate for checking whether encoding needs DWARF:

static bool encodingSpecifiesDWARF(uint32_t Encoding) { ... }

Predicate for checking whether record can be merged with a previous record with the same encoding:

static bool encodingCanBeMerged(uint32_t Encoding) { ... }

FIXME: Passing PtrSize as a template parameter is a hack to work around a bug in older MSVC compilers (until at least MSVC 15) where constexpr fields in the CRTP impl class were not visible to the base class. Once we no longer need to support these compilers the PtrSize template argument should be removed and PointerSize should be defined as a member in the CRTP Impl classes.

Definition at line 60 of file CompactUnwindSupport.h.

Member Function Documentation

◆ encodeDWARFOffset()

template<typename CRTPImpl, size_t PtrSize>
std::optional< uint32_t > llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize >::encodeDWARFOffset ( size_t Delta)
inlinestatic

Definition at line 84 of file CompactUnwindSupport.h.

◆ readEncoding()

template<typename CRTPImpl, size_t PtrSize>
uint32_t llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize >::readEncoding ( ArrayRef< char > RecordContent)
inlinestatic

◆ readPCRangeSize()

template<typename CRTPImpl, size_t PtrSize>
uint32_t llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize >::readPCRangeSize ( ArrayRef< char > RecordContent)
inlinestatic

Member Data Documentation

◆ EncodingFieldOffset

template<typename CRTPImpl, size_t PtrSize>
size_t llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize >::EncodingFieldOffset = SizeFieldOffset + 4
staticconstexpr

Definition at line 65 of file CompactUnwindSupport.h.

Referenced by readEncoding().

◆ FnFieldOffset

template<typename CRTPImpl, size_t PtrSize>
size_t llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize >::FnFieldOffset = 0
staticconstexpr

Definition at line 63 of file CompactUnwindSupport.h.

◆ LSDAFieldOffset

template<typename CRTPImpl, size_t PtrSize>
size_t llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize >::LSDAFieldOffset
staticconstexpr
Initial value:

Definition at line 67 of file CompactUnwindSupport.h.

◆ PersonalityFieldOffset

template<typename CRTPImpl, size_t PtrSize>
size_t llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize >::PersonalityFieldOffset = EncodingFieldOffset + 4
staticconstexpr

Definition at line 66 of file CompactUnwindSupport.h.

◆ PointerSize

template<typename CRTPImpl, size_t PtrSize>
size_t llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize >::PointerSize = PtrSize
staticconstexpr

Definition at line 61 of file CompactUnwindSupport.h.

◆ Size

template<typename CRTPImpl, size_t PtrSize>
size_t llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize >::Size = 3 * PointerSize + 2 * 4
staticconstexpr

Definition at line 62 of file CompactUnwindSupport.h.

◆ SizeFieldOffset

template<typename CRTPImpl, size_t PtrSize>
size_t llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize >::SizeFieldOffset = FnFieldOffset + PointerSize
staticconstexpr

Definition at line 64 of file CompactUnwindSupport.h.

Referenced by readPCRangeSize().


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