Go to the documentation of this file.
22 Limit.MaxLength = MaxLength;
23 Limit.BeginOffset = getCurrentOffset();
24 Limits.push_back(Limit);
29 assert(!Limits.empty() &&
"Not in a record!");
47 int PaddingBytes = 4 -
Align;
48 while (PaddingBytes > 0) {
49 char Pad =
static_cast<uint8_t
>(LF_PAD0 + PaddingBytes);
63 assert(!Limits.empty() &&
"Not in a record!");
69 uint32_t Offset = getCurrentOffset();
74 Min = Min ?
std::min(*Min, *ThisMin) : *ThisMin;
76 assert(Min &&
"Every field must have a maximum length!");
93 uint8_t Leaf = Reader->
peek();
98 unsigned BytesToAdvance = Leaf & 0x0F;
99 return Reader->
skip(BytesToAdvance);
103 const Twine &Comment) {
105 emitComment(Comment);
107 incrStreamedLen(Bytes.
size());
119 const Twine &Comment) {
124 Bytes.assign(BytesRef.
begin(), BytesRef.
end());
131 std::string TypeNameStr = Streamer->
getTypeName(TypeInd);
132 if (!TypeNameStr.empty())
133 emitComment(Comment +
": " + TypeNameStr);
135 emitComment(Comment);
137 incrStreamedLen(
sizeof(TypeInd.
getIndex()));
151 const Twine &Comment) {
154 emitEncodedUnsignedInteger(
static_cast<uint64_t>(
Value), Comment);
156 emitEncodedSignedInteger(
Value, Comment);
159 if (
auto EC = writeEncodedUnsignedInteger(
static_cast<uint64_t>(
Value)))
162 if (
auto EC = writeEncodedSignedInteger(
Value))
176 const Twine &Comment) {
178 emitEncodedUnsignedInteger(
Value, Comment);
180 if (
auto EC = writeEncodedUnsignedInteger(
Value))
195 if (
Value.isSigned())
196 emitEncodedSignedInteger(
Value.getSExtValue(), Comment);
198 emitEncodedUnsignedInteger(
Value.getZExtValue(), Comment);
200 if (
Value.isSigned())
201 return writeEncodedSignedInteger(
203 return writeEncodedUnsignedInteger(
Value.getLimitedValue());
212 emitComment(Comment);
213 Streamer->
emitBytes(NullTerminatedString);
214 incrStreamedLen(NullTerminatedString.size());
232 StringRef((
reinterpret_cast<const char *
>(&Guid)), GuidSize);
233 emitComment(Comment);
235 incrStreamedLen(GuidSize);
247 if (
auto EC = Reader->
readBytes(GuidBytes, GuidSize))
255 const Twine &Comment) {
258 emitComment(Comment);
259 for (
auto V :
Value) {
263 uint8_t FinalZero = 0;
279 void CodeViewRecordIO::emitEncodedSignedInteger(
const int64_t &
Value,
280 const Twine &Comment) {
285 emitComment(Comment);
291 emitComment(Comment);
297 emitComment(Comment);
303 emitComment(Comment);
308 emitComment(Comment);
314 void CodeViewRecordIO::emitEncodedUnsignedInteger(
const uint64_t &
Value,
315 const Twine &Comment) {
316 if (
Value < LF_NUMERIC) {
317 emitComment(Comment);
322 emitComment(Comment);
327 emitComment(Comment);
333 emitComment(Comment);
339 Error CodeViewRecordIO::writeEncodedSignedInteger(
const int64_t &
Value) {
371 if (
Value < LF_NUMERIC) {
uint64_t getStreamedLen()
This is an optimization pass for GlobalISel generic memory operations.
Error writeInteger(T Value)
Write the integer Value to the underlying stream in the specified endianness.
Error readBytes(ArrayRef< uint8_t > &Buffer, uint32_t Size)
Read Size bytes from the underlying stream at the current offset and and set Buffer to the resulting ...
void setIndex(uint32_t I)
Error mapByteVectorTail(ArrayRef< uint8_t > &Bytes, const Twine &Comment="")
Error skip(uint64_t Amount)
Advance the stream's offset by Amount bytes.
static ErrorSuccess success()
Create a success value.
This represents the 'GUID' type from windows.h.
Error mapStringZ(StringRef &Value, const Twine &Comment="")
uint64_t bytesRemaining() const
Error padToAlignment(uint32_t Align)
Expected< ExpressionValue > max(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
Error beginRecord(Optional< uint32_t > MaxLength)
StringRef toStringRef(const Optional< DWARFFormValue > &V, StringRef Default={})
Take an optional DWARFFormValue and try to extract a string value from it.
Error readInteger(T &Dest)
Read an integer of the specified endianness into Dest and update the stream's offset.
An arbitrary precision integer that knows its signedness.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Error padToAlignment(uint32_t Align)
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
Error mapStringZVectorZ(std::vector< StringRef > &Value, const Twine &Comment="")
virtual std::string getTypeName(TypeIndex TI)=0
Error readCString(StringRef &Dest)
Read a null terminated string from Dest.
virtual void emitBinaryData(StringRef Data)=0
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Error writeCString(StringRef Str)
Write the string Str to the underlying stream followed by a null terminator.
<%struct.s * > cast struct s *S to sbyte *< sbyte * > sbyte uint cast struct s *agg result to sbyte *< sbyte * > sbyte uint cast struct s *memtmp to sbyte *< sbyte * > sbyte uint ret void llc ends up issuing two memcpy or custom lower memcpy(of small size) to be ldmia/stmia. I think option 2 is better but the current register allocator cannot allocate a chunk of registers at a time. A feasible temporary solution is to use specific physical registers at the lowering time for small(<
Error consume(BinaryStreamReader &Reader)
Expected< ExpressionValue > min(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
Error writeBytes(ArrayRef< uint8_t > Buffer)
Write the bytes specified in Buffer to the underlying stream.
StringRef - Represent a constant reference to a string, i.e.
Error mapInteger(TypeIndex &TypeInd, const Twine &Comment="")
uint32_t maxFieldLength() const
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Error mapEncodedInteger(int64_t &Value, const Twine &Comment="")
Error padToAlignment(uint32_t Align)
Lightweight error class with error context and mandatory checking.
uint32_t getIndex() const
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
virtual void emitIntValue(uint64_t Value, unsigned Size)=0
uint8_t peek() const
Examine the next byte of the underlying stream without advancing the stream's offset.
size_t size() const
size - Get the array size.
Error mapGuid(GUID &Guid, const Twine &Comment="")
LLVM Value Representation.
virtual void emitBytes(StringRef Data)=0