17 using namespace llvm::codeview;
21 Limit.MaxLength = MaxLength;
22 Limit.BeginOffset = getCurrentOffset();
47 assert(Min.
hasValue() &&
"Every field must have a maximum length!");
58 uint8_t Leaf = Reader->
peek();
63 unsigned BytesToAdvance = Leaf & 0x0F;
64 return Reader->
skip(BytesToAdvance);
83 Bytes.assign(BytesRef.
begin(), BytesRef.
end());
105 if (
auto EC = writeEncodedUnsignedInteger(static_cast<uint64_t>(Value)))
108 if (
auto EC = writeEncodedSignedInteger(Value))
123 if (
auto EC = writeEncodedUnsignedInteger(Value))
138 return writeEncodedUnsignedInteger(Value.
getZExtValue());
141 return consume(*Reader, Value);
163 assert(Guid.
size() == 16 &&
"Invalid Guid Size!");
175 for (
auto V : Value) {
194 Error CodeViewRecordIO::writeEncodedSignedInteger(
const int64_t &
Value) {
195 assert(Value < 0 &&
"Encoded integer is not signed!");
197 if (
auto EC = Writer->
writeInteger(static_cast<uint16_t>(LF_CHAR)))
202 if (
auto EC = Writer->
writeInteger(static_cast<uint16_t>(LF_SHORT)))
207 if (
auto EC = Writer->
writeInteger(static_cast<uint16_t>(LF_LONG)))
212 if (
auto EC = Writer->
writeInteger(static_cast<uint16_t>(LF_QUADWORD)))
220 Error CodeViewRecordIO::writeEncodedUnsignedInteger(
const uint64_t &Value) {
221 if (Value < LF_NUMERIC) {
224 }
else if (Value <= std::numeric_limits<uint16_t>::max()) {
225 if (
auto EC = Writer->
writeInteger(static_cast<uint16_t>(LF_USHORT)))
229 }
else if (Value <= std::numeric_limits<uint32_t>::max()) {
230 if (
auto EC = Writer->
writeInteger(static_cast<uint16_t>(LF_ULONG)))
235 if (
auto EC = Writer->
writeInteger(static_cast<uint16_t>(LF_UQUADWORD)))
Error mapByteVectorTail(ArrayRef< uint8_t > &Bytes)
void push_back(const T &Elt)
Error readFixedString(StringRef &Dest, uint32_t Length)
Error writeZeroString(StringRef Str)
uint64_t getZExtValue() const
Get zero extended value.
Error consume(msf::StreamReader &Reader)
Error mapInteger(TypeIndex &TypeInd)
Error mapStringZVectorZ(std::vector< StringRef > &Value)
Error writeFixedString(StringRef Str)
int64_t getExtValue() const
Get the correctly-extended int64_t value.
void setIndex(uint32_t I)
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
Error readZeroString(StringRef &Dest)
Error beginRecord(Optional< uint32_t > MaxLength)
LLVM_NODISCARD bool empty() const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef take_front(size_t N=1) const
Return a StringRef equal to 'this' but with only the first N elements remaining.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with etc Experimental Use value profile to guide fuzzing Number of simultaneous worker processes to run the jobs If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
Error writeBytes(ArrayRef< uint8_t > Buffer)
uint32_t getIndex() const
Error readBytes(ArrayRef< uint8_t > &Buffer, uint32_t Size)
int64_t getSExtValue() const
Get sign extended value.
Error mapGuid(StringRef &Guid)
Error readInteger(uint8_t &Dest)
Error skip(uint32_t Amount)
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
uint32_t maxFieldLength() const
Error writeInteger(uint8_t Int)
static ErrorSuccess success()
Create a success value.
Error mapEncodedInteger(int64_t &Value)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
Error mapStringZ(StringRef &Value)
uint32_t bytesRemaining() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.