LLVM 24.0.0git
llvm::ubi::ByteValue Class Reference

Represents a scalar byte value. More...

#include "llvm/UBAwareInterpreter/Value.h"

Public Types

enum class  CanonicalizeMode { Canonical , PaddingFromValue , FlushNonCanonicalToPoison }
 Specify how to treat the input. More...

Public Member Functions

LLVM_ABI ByteValue (const APInt &V, bool IsLittleEndian)
 ByteValue (uint32_t BitWidth, ArrayRef< Byte > Val, bool IsLittleEndian, CanonicalizeMode Mode=CanonicalizeMode::Canonical)
 ByteValue (uint32_t BitWidth, std::vector< Byte > Val, bool IsLittleEndian, CanonicalizeMode Mode=CanonicalizeMode::Canonical)
 ByteValue (const ByteValue &)=default
 ByteValue (ByteValue &&)=default
ByteValue & operator= (const ByteValue &)=default
ByteValue & operator= (ByteValue &&)=default
 ~ByteValue ()=default
uint32_t getBitWidth () const
ArrayRef< Byte > bytes () const
MutableArrayRef< Byte > mutableBytes ()
 The caller should call canonicalize after mutation.
void canonicalize (CanonicalizeMode Mode)
 Make sure the padding byte is canonical.
bool isValid () const
LLVM_ABI void print (Context &Ctx, raw_ostream &OS) const

Static Public Member Functions

static LLVM_ABI ByteValue zero (uint32_t BitWidth, bool IsLittleEndian)
static LLVM_ABI ByteValue poison (uint32_t BitWidth, bool IsLittleEndian)

Detailed Description

Represents a scalar byte value.

If the value is not byte-sized, the padding bits are guaranteed to be filled by either poison/zero bits.

Byte values do not contain undef bits. The only exception is Context::fromBytes, which converts undef bits into poison bits after constructor.

Definition at line 257 of file Value.h.

Member Enumeration Documentation

◆ CanonicalizeMode

Specify how to treat the input.

Enumerator
Canonical 
PaddingFromValue 
FlushNonCanonicalToPoison 

Definition at line 265 of file Value.h.

Constructor & Destructor Documentation

◆ ByteValue() [1/5]

llvm::ubi::ByteValue::ByteValue ( const APInt & V,
bool IsLittleEndian )

◆ ByteValue() [2/5]

llvm::ubi::ByteValue::ByteValue ( uint32_t BitWidth,
ArrayRef< Byte > Val,
bool IsLittleEndian,
CanonicalizeMode Mode = CanonicalizeMode::Canonical )
inline

Definition at line 276 of file Value.h.

References ByteValue(), Canonical, and Mode.

◆ ByteValue() [3/5]

llvm::ubi::ByteValue::ByteValue ( uint32_t BitWidth,
std::vector< Byte > Val,
bool IsLittleEndian,
CanonicalizeMode Mode = CanonicalizeMode::Canonical )
inline

Definition at line 279 of file Value.h.

References assert(), Canonical, canonicalize(), isValid(), Mode, and llvm::move().

◆ ByteValue() [4/5]

llvm::ubi::ByteValue::ByteValue ( const ByteValue & )
default

References ByteValue().

◆ ByteValue() [5/5]

llvm::ubi::ByteValue::ByteValue ( ByteValue && )
default

References ByteValue().

◆ ~ByteValue()

llvm::ubi::ByteValue::~ByteValue ( )
default

References ByteValue(), and LLVM_ABI.

Member Function Documentation

◆ bytes()

ArrayRef< Byte > llvm::ubi::ByteValue::bytes ( ) const
inline

Definition at line 298 of file Value.h.

◆ canonicalize()

void llvm::ubi::ByteValue::canonicalize ( CanonicalizeMode Mode)
inline

◆ getBitWidth()

uint32_t llvm::ubi::ByteValue::getBitWidth ( ) const
inline

◆ isValid()

bool llvm::ubi::ByteValue::isValid ( ) const
inline

Definition at line 322 of file Value.h.

References llvm::ubi::Byte::isCanonicalPaddingByte().

Referenced by ByteValue(), and canonicalize().

◆ mutableBytes()

MutableArrayRef< Byte > llvm::ubi::ByteValue::mutableBytes ( )
inline

The caller should call canonicalize after mutation.

Definition at line 300 of file Value.h.

Referenced by llvm::ubi::Context::freeze(), and llvm::ubi::Context::fromBytes().

◆ operator=() [1/2]

ByteValue & llvm::ubi::ByteValue::operator= ( ByteValue && )
default

References ByteValue().

◆ operator=() [2/2]

ByteValue & llvm::ubi::ByteValue::operator= ( const ByteValue & )
default

References ByteValue().

◆ poison()

ByteValue llvm::ubi::ByteValue::poison ( uint32_t BitWidth,
bool IsLittleEndian )
static

◆ print()

◆ zero()

ByteValue llvm::ubi::ByteValue::zero ( uint32_t BitWidth,
bool IsLittleEndian )
static

The documentation for this class was generated from the following files: