10 #ifndef LLVM_SUPPORT_DATAEXTRACTOR_H 11 #define LLVM_SUPPORT_DATAEXTRACTOR_H 22 Bytes[0] = Bytes[1] = Bytes[2] = U;
24 Uint24(uint8_t U0, uint8_t U1, uint8_t U2) {
25 Bytes[0] = U0; Bytes[1] = U1; Bytes[2] = U2;
28 int LoIx = IsLittleEndian ? 0 : 2;
29 return Bytes[LoIx] + (Bytes[1] << 8) + (Bytes[2-LoIx] << 16);
34 static_assert(
sizeof(
uint24_t) == 3,
"sizeof(uint24_t) != 3");
43 uint8_t IsLittleEndian;
52 : Data(Data), IsLittleEndian(IsLittleEndian), AddressSize(AddressSize) {}
83 const char *getCStr(
uint32_t *offset_ptr)
const;
176 return getUnsigned(offset_ptr, AddressSize);
193 uint8_t getU8(
uint32_t *offset_ptr)
const;
236 uint16_t getU16(
uint32_t *offset_ptr)
const;
261 uint16_t *getU16(
uint32_t *offset_ptr, uint16_t *dst,
uint32_t count)
const;
335 uint64_t getU64(
uint32_t *offset_ptr)
const;
360 uint64_t *getU64(
uint32_t *offset_ptr, uint64_t *dst,
uint32_t count)
const;
378 int64_t getSLEB128(
uint32_t *offset_ptr)
const;
396 uint64_t getULEB128(
uint32_t *offset_ptr)
const;
411 return offset + length >= offset && isValidOffset(offset + length - 1);
422 return isValidOffsetForDataOfSize(offset, AddressSize);
This class represents lattice values for constants.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
uint32_t getAsUint32(bool IsLittleEndian) const
An auxiliary type to facilitate extraction of 3-byte entities.
auto count(R &&Range, const E &Element) -> typename std::iterator_traits< decltype(adl_begin(Range))>::difference_type
Wrapper function around std::count to count the number of times an element Element occurs in the give...
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
uint24_t getSwappedBytes(uint24_t C)
Needed by swapByteOrder().
Uint24(uint8_t U0, uint8_t U1, uint8_t U2)
StringRef - Represent a constant reference to a string, i.e.