struct Bitfield

Declaration

struct Bitfield { /* full declaration omitted */ };

Description

Holds functions to get, set or test bitfields.

Declared at: llvm/include/llvm/ADT/Bitfields.h:212

Method Overview

  • public template <typename A>static constexpr bool areContiguous()
  • public template <typename A, typename B, typename... Others>static constexpr bool areContiguous()
  • public template <typename Bitfield, typename StorageType>static typename Bitfield::Type get(StorageType Packed)
  • public template <typename A, typename B>static constexpr bool isOverlapping()
  • public template <typename Bitfield, typename StorageType>static void set(StorageType & Packed, typename Bitfield::Type Value)
  • public template <typename Bitfield, typename StorageType>static StorageType test(StorageType Packed)

Methods

template <typename A>
static constexpr bool areContiguous()

Declared at: llvm/include/llvm/ADT/Bitfields.h:280

Templates

A

template <typename A,
          typename B,
          typename... Others>
static constexpr bool areContiguous()

Declared at: llvm/include/llvm/ADT/Bitfields.h:282

Templates

A
B
Others

template <typename Bitfield, typename StorageType>
static typename Bitfield::Type get(
    StorageType Packed)

Description

Unpacks the field from the `Packed` value.

Declared at: llvm/include/llvm/ADT/Bitfields.h:254

Templates

Bitfield
StorageType

Parameters

StorageType Packed

template <typename A, typename B>
static constexpr bool isOverlapping()

Description

Returns whether the two bitfields share common bits.

Declared at: llvm/include/llvm/ADT/Bitfields.h:276

Templates

A
B

template <typename Bitfield, typename StorageType>
static void set(StorageType& Packed,
                typename Bitfield::Type Value)

Description

Sets the typed value in the provided `Packed` value. The method will asserts if the provided value is too big to fit in.

Declared at: llvm/include/llvm/ADT/Bitfields.h:270

Templates

Bitfield
StorageType

Parameters

StorageType& Packed
typename Bitfield::Type Value

template <typename Bitfield, typename StorageType>
static StorageType test(StorageType Packed)

Description

Return a non-zero value if the field is non-zero. It is more efficient than `getField`.

Declared at: llvm/include/llvm/ADT/Bitfields.h:262

Templates

Bitfield
StorageType

Parameters

StorageType Packed