23bool ContiguousBlobAccumulator::checkLimit(
uint64_t Size) {
25 if (!ReachedLimitErr && Off <= MaxSize &&
Size <= MaxSize - Off)
29 "reached the output size limit");
39 uint64_t PaddingSize = AlignedOffset - CurrentOffset;
40 if (!checkLimit(PaddingSize))
50 if (!checkLimit(std::min<uint64_t>(
Bin.binary_size(),
N)))
52 Bin.writeAsBinary(OS,
N);
70 memcpy(&Buf[Pos - InitialOffset],
Data,
Size);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines ContiguousBlobAccumulator, the size-limited output buffer shared by the yaml2obj em...
Specialized YAMLIO scalar type for representing a binary blob.
LLVM_ABI uint64_t padToAlignment(unsigned Align)
LLVM_ABI unsigned writeSLEB128(int64_t Val)
LLVM_ABI void writeAsBinary(const BinaryRef &Bin, uint64_t N=UINT64_MAX)
uint64_t getOffset() const
void writeZeros(uint64_t Num)
LLVM_ABI unsigned writeULEB128(uint64_t Val)
LLVM_ABI void updateDataAt(uint64_t Pos, const void *Data, size_t Size)
This is an optimization pass for GlobalISel generic memory operations.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
unsigned encodeSLEB128(int64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a SLEB128 value to an output stream.
unsigned encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a ULEB128 value to an output stream.
This struct is a compact representation of a valid (non-zero power of two) alignment.