LLVM  14.0.0git
Classes | Static Public Member Functions | List of all members
llvm::Bitfield Struct Reference

Holds functions to get, set or test bitfields. More...

#include "llvm/ADT/Bitfields.h"

Classes

struct  Element
 Describes an element of a Bitfield. More...
 

Static Public Member Functions

template<typename Bitfield , typename StorageType >
static Bitfield::Type get (StorageType Packed)
 Unpacks the field from the Packed value. More...
 
template<typename Bitfield , typename StorageType >
static StorageType test (StorageType Packed)
 Return a non-zero value if the field is non-zero. More...
 
template<typename Bitfield , typename StorageType >
static void set (StorageType &Packed, typename Bitfield::Type Value)
 Sets the typed value in the provided Packed value. More...
 
template<typename A , typename B >
static constexpr bool isOverlapping ()
 Returns whether the two bitfields share common bits. More...
 
template<typename A >
static constexpr bool areContiguous ()
 
template<typename A , typename B , typename... Others>
static constexpr bool areContiguous ()
 

Detailed Description

Holds functions to get, set or test bitfields.

Definition at line 212 of file Bitfields.h.

Member Function Documentation

◆ areContiguous() [1/2]

template<typename A >
static constexpr bool llvm::Bitfield::areContiguous ( )
inlinestaticconstexpr

Definition at line 280 of file Bitfields.h.

Referenced by areContiguous().

◆ areContiguous() [2/2]

template<typename A , typename B , typename... Others>
static constexpr bool llvm::Bitfield::areContiguous ( )
inlinestaticconstexpr

Definition at line 282 of file Bitfields.h.

References areContiguous(), and B.

◆ get()

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

Unpacks the field from the Packed value.

Definition at line 254 of file Bitfields.h.

References extract, and I.

◆ isOverlapping()

template<typename A , typename B >
static constexpr bool llvm::Bitfield::isOverlapping ( )
inlinestaticconstexpr

Returns whether the two bitfields share common bits.

Definition at line 276 of file Bitfields.h.

◆ set()

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

Sets the typed value in the provided Packed value.

The method will asserts if the provided value is too big to fit in.

Definition at line 270 of file Bitfields.h.

References I.

◆ test()

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

Return a non-zero value if the field is non-zero.

It is more efficient than getField.

Definition at line 262 of file Bitfields.h.

References I, and test.


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