21 "unexpected end of data");
34 uint64_t offset = *offset_ptr;
39 std::memcpy(&val, &Data[offset],
sizeof(val));
44 *offset_ptr +=
sizeof(val);
56 uint64_t offset = *offset_ptr;
62 for (
T *value_ptr = dst, *
end = dst + count; value_ptr !=
end;
63 ++value_ptr, offset +=
sizeof(*dst))
64 *value_ptr = getU<T>(offset_ptr, de, isLittleEndian, Data, Err);
73 return getU<uint8_t>(offset_ptr,
this, IsLittleEndian, Data.
data(), Err);
78 return getUs<uint8_t>(offset_ptr, dst,
count,
this, IsLittleEndian,
79 Data.
data(),
nullptr);
83 return getUs<uint8_t>(&C.Offset, Dst, Count,
this, IsLittleEndian,
88 return getU<uint16_t>(offset_ptr,
this, IsLittleEndian, Data.
data(), Err);
93 return getUs<uint16_t>(offset_ptr, dst,
count,
this, IsLittleEndian,
94 Data.
data(),
nullptr);
99 getU<uint24_t>(offset_ptr,
this, IsLittleEndian, Data.
data(),
nullptr);
105 return getU<uint32_t>(offset_ptr,
this, IsLittleEndian, Data.
data(), Err);
110 return getUs<uint32_t>(offset_ptr, dst,
count,
this, IsLittleEndian,
111 Data.
data(),
nullptr);
115 return getU<uint64_t>(offset_ptr,
this, IsLittleEndian, Data.
data(), Err);
120 return getUs<uint64_t>(offset_ptr, dst,
count,
this, IsLittleEndian,
121 Data.
data(),
nullptr);
128 return getU8(offset_ptr, Err);
130 return getU16(offset_ptr, Err);
132 return getU32(offset_ptr, Err);
134 return getU64(offset_ptr, Err);
143 return (int8_t)
getU8(offset_ptr);
145 return (int16_t)
getU16(offset_ptr);
147 return (int32_t)
getU32(offset_ptr);
149 return (int64_t)
getU64(offset_ptr);
155 uint64_t offset = *offset_ptr;
158 *offset_ptr = pos + 1;
159 return Data.
data() + offset;
165 uint64_t Start = *offset_ptr;
168 *offset_ptr = Pos + 1;
184 reinterpret_cast<const uint8_t *>(Data.
data() + *offset_ptr), &bytes_read,
185 reinterpret_cast<const uint8_t *>(Data.
data() + Data.
size()), &error);
191 *offset_ptr += bytes_read;
201 reinterpret_cast<const uint8_t *>(Data.
data() + *offset_ptr), &bytes_read,
202 reinterpret_cast<const uint8_t *>(Data.
data() + Data.
size()), &error);
205 *offset_ptr += bytes_read;
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
An auxiliary type to facilitate extraction of 3-byte entities.
int64_t decodeSLEB128(const uint8_t *p, unsigned *n=nullptr, const uint8_t *end=nullptr, const char **error=nullptr)
Utility function to decode a SLEB128 value.
static const bool IsLittleEndianHost
LLVM_NODISCARD size_t size() const
size - Get the string size.
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...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
LLVM_NODISCARD size_t find(char C, size_t From=0) const
Search for the first character C in the string.
uint64_t decodeULEB128(const uint8_t *p, unsigned *n=nullptr, const uint8_t *end=nullptr, const char **error=nullptr)
Utility function to decode a ULEB128 value.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Helper for Errors used as out-parameters.
LLVM_NODISCARD const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.