LLVM 22.0.0git
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.
template<typename Bitfield, typename StorageType>
static StorageType test (StorageType Packed)
 Return a non-zero value if the field is non-zero.
template<typename Bitfield, typename StorageType>
static void set (StorageType &Packed, typename Bitfield::Type Value)
 Sets the typed value in the provided Packed value.
template<typename A, typename B>
static constexpr bool isOverlapping ()
 Returns whether the two bitfields share common bits.
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>
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>
constexpr bool llvm::Bitfield::areContiguous ( )
inlinestaticconstexpr

Definition at line 282 of file Bitfields.h.

References areContiguous(), and B().

◆ get()

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

◆ isOverlapping()

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

Returns whether the two bitfields share common bits.

Definition at line 276 of file Bitfields.h.

Referenced by llvm::Instruction::getSubclassData(), and llvm::Instruction::setSubclassData().

◆ set()

template<typename Bitfield, typename StorageType>
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.

Referenced by llvm::InlineAsm::Flag::clearMemConstraint(), llvm::InlineAsm::Flag::Flag(), llvm::InlineAsm::Flag::setMatchingOp(), llvm::InlineAsm::Flag::setMemConstraint(), llvm::InlineAsm::Flag::setRegClass(), llvm::InlineAsm::Flag::setRegMayBeFolded(), and llvm::Instruction::setSubclassData().

◆ test()

template<typename Bitfield, typename StorageType>
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.


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