10 #ifndef LLVM_DEBUGINFO_CODEVIEW_TYPETABLEBUILDER_H
11 #define LLVM_DEBUGINFO_CODEVIEW_TYPETABLEBUILDER_H
23 #include <type_traits>
31 assert(
false &&
"Couldn't write Type!");
41 : Allocator(Allocator), Serializer(Allocator) {}
50 static_assert(!std::is_same<T, FieldListRecord>::value,
51 "Can't serialize FieldList!");
56 return handleError(std::move(EC));
57 if (
auto EC = Serializer.visitKnownRecord(Type, Record))
58 return handleError(std::move(EC));
62 return handleError(ExpectedIndex.takeError());
64 return *ExpectedIndex;
92 : TypeTable(TypeTable), TempSerializer(TypeTable.getAllocator()) {
93 Type.
Type = TypeLeafKind::LF_FIELDLIST;
106 if (
auto EC = TempSerializer.visitKnownMember(CVMR, Record))
129 #endif // LLVM_DEBUGINFO_CODEVIEW_TYPETABLEBUILDER_H
TypeIndex writeKnownType(T &Record)
TypeLeafKind
Duplicate copy of the above enum, but using the official CV names.
Error visitMemberBegin(CVMemberRecord &Record) override
Error visitTypeEnd(CVType &Record) override
TypeTableBuilder & operator=(const TypeTableBuilder &)=delete
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
ArrayRef< MutableArrayRef< uint8_t > > records() const
ArrayRef< MutableArrayRef< uint8_t > > records() const
static const uint32_t FirstNonSimpleIndex
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Type(LLVMContext &C, TypeID tid)
Error visitTypeBegin(CVType &Record) override
Paired begin/end actions for all types.
The instances of the Type class are immutable: once they are created, they are never changed...
Allocate memory in an ever growing pool, as if by bump-pointer.
TypeIndex insertRecordBytes(MutableArrayRef< uint8_t > Record)
BumpPtrAllocator & getAllocator() const
void consumeError(Error Err)
Consume a Error without doing anything.
FieldListRecordBuilder(TypeTableBuilder &TypeTable)
void writeMemberType(T &Record)
void ForEachRecord(TFunc Func)
Error visitMemberEnd(CVMemberRecord &Record) override
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
TypeIndex writeSerializedRecord(MutableArrayRef< uint8_t > Record)
TypeTableBuilder(BumpPtrAllocator &Allocator)
Expected< TypeIndex > visitTypeEndGetIndex(CVType &Record)