|
LLVM 23.0.0git
|
Classes | |
| class | PointerUnionMembers |
| CRTP base that generates non-template constructors and assignment operators for each type in the union. More... | |
| class | PointerUnionMembers< Derived, Idx > |
| class | PointerUnionMembers< Derived, Idx, Type, Types... > |
| struct | TagEntry |
| Tag descriptor for one type in the union. More... | |
Functions | |
| constexpr int | bitsRequired (unsigned NumValues) |
| Determine the number of bits required to store values in [0, NumValues). | |
| template<typename... Ts> | |
| constexpr int | lowBitsAvailable () |
| template<typename... PTs> | |
| constexpr bool | useFixedWidthTags () |
| True if all types have enough low bits for a fixed-width tag. | |
| template<typename... PTs> | |
| constexpr bool | typesInNonDecreasingBitOrder () |
| True if types are in non-decreasing NumLowBitsAvailable order. | |
| template<typename... PTs> | |
| constexpr std::array< TagEntry, sizeof...(PTs)> | computeFixedTags () |
| Compute fixed-width tag table (all types have enough bits for the tag). | |
| template<typename... PTs> | |
| constexpr std::optional< std::array< TagEntry, sizeof...(PTs)> > | computeExtendedTags () |
| Compute variable-width tag table, or return std::nullopt if the types don't fit. | |
|
constexpr |
Determine the number of bits required to store values in [0, NumValues).
This is ceil(log2(NumValues)).
Definition at line 36 of file PointerUnion.h.
References llvm::bit_width_constexpr().
Referenced by computeFixedTags(), and useFixedWidthTags().
|
constexpr |
Compute variable-width tag table, or return std::nullopt if the types don't fit.
Types must be in non-decreasing NumLowBitsAvailable order. Groups types by available bits into tiers; each non-final tier reserves its highest code as an escape prefix.
Example with 3 tiers (2-bit, 3-bit, 5-bit types): Tier 0 (2 bits): codes 0b00, 0b01, 0b10; escape = 0b11 Tier 1 (3 bits): codes 0b011, escape = 0b111 Tier 2 (5 bits): codes 0b00111, 0b01111, 0b10111, 0b11111
Definition at line 92 of file PointerUnion.h.
|
constexpr |
Compute fixed-width tag table (all types have enough bits for the tag).
For example, with 4 types and 3 available bits, the tag is 2 bits wide (values 0-3) and each entry has the same mask of 0x3.
Definition at line 70 of file PointerUnion.h.
References bitsRequired(), I, and N.
|
constexpr |
Definition at line 40 of file PointerUnion.h.
Referenced by useFixedWidthTags().
|
constexpr |
True if types are in non-decreasing NumLowBitsAvailable order.
Definition at line 52 of file PointerUnion.h.
References I.
|
constexpr |
True if all types have enough low bits for a fixed-width tag.
Definition at line 46 of file PointerUnion.h.
References bitsRequired(), and lowBitsAvailable().
Referenced by llvm::PointerUnion< TrivialCallback *, NonTrivialCallbacks * >::PointerLikeTypeTraits.