9#ifndef LLVM_SUPPORT_DATAEXTRACTOR_H
10#define LLVM_SUPPORT_DATAEXTRACTOR_H
26 int LoIx = IsLittleEndian ? 0 : 2;
32static_assert(
sizeof(
uint24_t) == 3,
"sizeof(uint24_t) != 3");
36 return uint24_t(
C.Bytes[2],
C.Bytes[1],
C.Bytes[0]);
65 explicit operator bool() {
return !Err; }
85 : Data(Data), IsLittleEndian(IsLittleEndian) {}
90 IsLittleEndian(IsLittleEndian) {}
159 Error *Err =
nullptr)
const;
230 Error *Err =
nullptr)
const;
270 Error *Err =
nullptr)
const;
381 return static_cast<int8_t
>(
getU8(OffsetPtr, Err));
448 return static_cast<int16_t
>(
getU16(OffsetPtr, Err));
541 return static_cast<int32_t
>(
getU32(OffsetPtr, Err));
606 return static_cast<int64_t
>(
getU64(OffsetPtr, Err));
697 Error *Err =
nullptr)
const;
729 return offset + length >= offset &&
isValidOffset(offset + length - 1);
733 size_t size()
const {
return Data.size(); }
747 template <
typename T>
T getU(
uint64_t *OffsetPtr,
Error *Err)
const;
748 template <
typename T>
This file implements the APSInt class, which is a simple class that represents an arbitrary sized int...
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
An arbitrary precision integer that knows its signedness.
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...
Represent a constant reference to a string, i.e.
constexpr const char * data() const
Get a pointer to the start of the string (which may not be null terminated).
This is an optimization pass for GlobalISel generic memory operations.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
uint24_t getSwappedBytes(uint24_t C)
Needed by swapByteOrder().
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
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...
LogicalResult success(bool IsSuccess=true)
Utility function to generate a LogicalResult.
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)