9#ifndef LLVM_SUPPORT_DATAEXTRACTOR_H
10#define LLVM_SUPPORT_DATAEXTRACTOR_H
29 int LoIx = IsLittleEndian ? 0 : 2;
35static_assert(
sizeof(
uint24_t) == 3,
"sizeof(uint24_t) != 3");
39 return uint24_t(
C.Bytes[2],
C.Bytes[1],
C.Bytes[0]);
68 explicit operator bool() {
return !Err; }
88 : Data(Data), IsLittleEndian(IsLittleEndian), AddressSize(AddressSize) {}
93 IsLittleEndian(IsLittleEndian), AddressSize(AddressSize) {}
166 Error *Err =
nullptr)
const;
237 Error *Err =
nullptr)
const;
277 Error *Err =
nullptr)
const;
407 getU8(
C, Dst.data(), Count);
414 return static_cast<int8_t
>(
getU8(OffsetPtr, Err));
481 return static_cast<int16_t
>(
getU16(OffsetPtr, Err));
574 return static_cast<int32_t
>(
getU32(OffsetPtr, Err));
639 return static_cast<int64_t
>(
getU64(OffsetPtr, Err));
729 return offset + length >= offset &&
isValidOffset(offset + length - 1);
744 size_t size()
const {
return Data.size(); }
758 template <
typename T>
T getU(
uint64_t *OffsetPtr,
Error *Err)
const;
759 template <
typename T>
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringRef - Represent a constant reference to a string, i.e.
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
uint24_t getSwappedBytes(uint24_t C)
Needed by swapByteOrder().
auto count(R &&Range, const E &Element)
Wrapper function around std::count to count the number of times an element Element occurs in the give...
An auxiliary type to facilitate extraction of 3-byte entities.
uint32_t getAsUint32(bool IsLittleEndian) const
Uint24(uint8_t U0, uint8_t U1, uint8_t U2)