10 #ifndef LLVM_DEBUGINFO_CODEVIEW_CODEVIEWRECORDIO_H 11 #define LLVM_DEBUGINFO_CODEVIEW_CODEVIEWRECORDIO_H 25 #include <type_traits> 44 bool isReading()
const {
return Reader !=
nullptr; }
71 using U =
typename std::underlying_type<T>::type;
74 X = static_cast<U>(Value);
79 Value = static_cast<T>(X);
91 template <
typename SizeType,
typename T,
typename ElementMapper>
95 Size =
static_cast<SizeType
>(Items.size());
99 for (
auto &
X : Items) {
100 if (
auto EC = Mapper(*
this,
X))
106 for (SizeType
I = 0;
I <
Size; ++
I) {
107 typename T::value_type Item;
108 if (
auto EC = Mapper(*
this, Item))
110 Items.push_back(Item);
117 template <
typename T,
typename ElementMapper>
120 for (
auto &Item : Items) {
121 if (
auto EC = Mapper(*
this, Item))
125 typename T::value_type
Field;
127 while (!Reader->
empty() && Reader->
peek() < 0xf0 ) {
128 if (
auto EC = Mapper(*
this, Field))
130 Items.push_back(Field);
143 Error writeEncodedSignedInteger(
const int64_t &Value);
144 Error writeEncodedUnsignedInteger(
const uint64_t &Value);
153 assert(CurrentOffset >= BeginOffset);
155 uint32_t BytesUsed = CurrentOffset - BeginOffset;
156 if (BytesUsed >= *MaxLength)
158 return *MaxLength - BytesUsed;
171 #endif // LLVM_DEBUGINFO_CODEVIEW_CODEVIEWRECORDIO_H Error writeObject(const T &Obj)
Writes the object Obj to the underlying stream, as if by using memcpy.
Error mapByteVectorTail(ArrayRef< uint8_t > &Bytes)
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
Error mapVectorN(T &Items, const ElementMapper &Mapper)
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
This class represents lattice values for constants.
Error mapObject(T &Value)
Error readInteger(T &Dest)
Read an integer of the specified endianness into Dest and update the stream's offset.
Error mapInteger(TypeIndex &TypeInd)
Error mapStringZVectorZ(std::vector< StringRef > &Value)
Error readObject(const T *&Dest)
Get a pointer to an object of type T from the underlying stream, as if by memcpy, and store the resul...
uint8_t peek() const
Examine the next byte of the underlying stream without advancing the stream's offset.
CodeViewRecordIO(BinaryStreamWriter &Writer)
Error mapGuid(GUID &Guid)
Error beginRecord(Optional< uint32_t > MaxLength)
This represents the 'GUID' type from windows.h.
uint32_t getOffset() const
uint32_t maxFieldLength() const
Error padToAlignment(uint32_t Align)
uint32_t getOffset() const
Error mapInteger(T &Value)
Provides write only access to a subclass of WritableBinaryStream.
CodeViewRecordIO(BinaryStreamReader &Reader)
Error writeInteger(T Value)
Write the integer Value to the underlying stream in the specified endianness.
static ErrorSuccess success()
Create a success value.
Error mapEncodedInteger(int64_t &Value)
Error mapStringZ(StringRef &Value)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Lightweight error class with error context and mandatory checking.
Error mapVectorTail(T &Items, const ElementMapper &Mapper)
Provides read only access to a subclass of BinaryStream.
StringRef - Represent a constant reference to a string, i.e.