18 bool isLittleEndian,
const char *
Data) {
27 *offset_ptr +=
sizeof(val);
38 for (
T *value_ptr = dst, *
end = dst + count; value_ptr !=
end;
39 ++value_ptr, offset +=
sizeof(*dst))
40 *value_ptr = getU<T>(offset_ptr, de, isLittleEndian, Data);
51 return getU<uint8_t>(offset_ptr,
this, IsLittleEndian, Data.
data());
56 return getUs<uint8_t>(offset_ptr, dst,
count,
this, IsLittleEndian,
62 return getU<uint16_t>(offset_ptr,
this, IsLittleEndian, Data.
data());
67 return getUs<uint16_t>(offset_ptr, dst,
count,
this, IsLittleEndian,
73 getU<uint24_t>(offset_ptr,
this, IsLittleEndian, Data.
data());
79 return getU<uint32_t>(offset_ptr,
this, IsLittleEndian, Data.
data());
84 return getUs<uint32_t>(offset_ptr, dst,
count,
this, IsLittleEndian,
89 return getU<uint64_t>(offset_ptr,
this, IsLittleEndian, Data.
data());
94 return getUs<uint64_t>(offset_ptr, dst,
count,
this, IsLittleEndian,
102 return getU8(offset_ptr);
104 return getU16(offset_ptr);
106 return getU32(offset_ptr);
108 return getU64(offset_ptr);
117 return (int8_t)
getU8(offset_ptr);
119 return (int16_t)
getU16(offset_ptr);
121 return (int32_t)
getU32(offset_ptr);
123 return (int64_t)
getU64(offset_ptr);
132 *offset_ptr = pos + 1;
133 return Data.
data() + offset;
142 *OffsetPtr = Pos + 1;
158 byte = Data[offset++];
159 result |= uint64_t(byte & 0x7f) << shift;
161 if ((byte & 0x80) == 0)
165 *offset_ptr = offset;
179 byte = Data[offset++];
180 result |= uint64_t(byte & 0x7f) << shift;
182 if ((byte & 0x80) == 0)
187 if (shift < 64 && (byte & 0x40))
188 result |= -(1ULL << shift);
190 *offset_ptr = offset;
const_iterator end(StringRef path)
Get end iterator over path.
void swapByteOrder(T &Value)
This class represents lattice values for constants.
uint32_t getAsUint32(bool IsLittleEndian) const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
An auxiliary type to facilitate extraction of 3-byte entities.
static const bool IsLittleEndianHost
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
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...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
StringRef - Represent a constant reference to a string, i.e.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t find(char C, size_t From=0) const
Search for the first character C in the string.