8#ifndef LLVM_CLANG_AST_INTERP_BITCAST_BUFFER_H
9#define LLVM_CLANG_AST_INTERP_BITCAST_BUFFER_H
11#include "llvm/ADT/SmallVector.h"
28 explicit Bits(
size_t Quantity) :
N(Quantity) {}
57 explicit Bytes(
size_t Quantity) :
N(Quantity) {}
83 std::unique_ptr<std::byte[]>
Data;
89 Data = std::make_unique<std::byte[]>(ByteSize);
95 return Data.get() + Offset;
121 Endian TargetEndianness)
const;
125 assert(Offset.getQuantity() <
FinalBitSize.roundToBytes());
126 assert((Offset.getQuantity() +
sizeof(
T)) <=
FinalBitSize.roundToBytes());
127 return *
reinterpret_cast<T *
>(
Data.get() + Offset.getQuantity());
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
@ Other
Other implicit parameter.
bool operator<(BitRange Other) const
BitRange(Bits Start, Bits End)
std::unique_ptr< std::byte[]> copyBits(Bits BitOffset, Bits BitWidth, Bits FullBitWidth, Endian TargetEndianness) const
Copy BitWidth bits at offset BitOffset from the buffer.
T deref(Bytes Offset) const
Dereferences the value at the given offset.
void markInitialized(Bits Start, Bits Length)
Marks the bits in the given range as initialized.
llvm::SmallVector< BitRange > InitializedBits
bool allInitialized() const
Returns true if all bits in the buffer have been initialized.
BitcastBuffer(Bits FinalBitSize)
bool rangeInitialized(Bits Offset, Bits Length) const
std::byte * atByte(unsigned Offset)
Returns the byte at the given offset.
Bits size() const
Returns the buffer size in bits.
void pushData(const std::byte *In, Bits BitOffset, Bits BitWidth, Endian TargetEndianness)
Push BitWidth bits at BitOffset from In into the buffer.
std::unique_ptr< std::byte[]> Data
bool operator!=(Bits Other) const
bool operator==(Bits Other) const
size_t roundToBytes() const
Bits operator+=(size_t O)
bool operator<=(Bits Other) const
Bits operator-(Bits Other) const
Bits operator+(Bits Other) const
size_t getOffsetInByte() const
bool operator>=(Bits Other) const
size_t getQuantity() const
size_t getQuantity() const