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 bool WriteUnique =
true)
42 : Allocator(Allocator), Serializer(Allocator, WriteUnique) {}
51 static_assert(!std::is_same<T, FieldListRecord>::value,
52 "Can't serialize FieldList!");
57 return handleError(std::move(EC));
58 if (
auto EC = Serializer.visitKnownRecord(Type, Record))
59 return handleError(std::move(EC));
63 return handleError(ExpectedIndex.takeError());
65 return *ExpectedIndex;
96 : TypeTable(TypeTable), TempSerializer(Allocator,
false) {
97 Type.
Type = TypeLeafKind::LF_FIELDLIST;
101 TempSerializer.
reset();
112 if (
auto EC = TempSerializer.visitKnownMember(CVMR, Record))
137 #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
TypeIndex insertRecord(const RemappedType &Record)
Error visitTypeEnd(CVType &Record) override
TypeTableBuilder & operator=(const TypeTableBuilder &)=delete
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
TypeIndex end(bool Write)
TypeIndex writeSerializedRecord(const RemappedType &Record)
static const uint32_t FirstNonSimpleIndex
Type(LLVMContext &C, TypeID tid)
TypeIndex writeSerializedRecord(ArrayRef< uint8_t > Record)
Error visitTypeBegin(CVType &Record) override
Paired begin/end actions for all types.
Function Alias Analysis false
TypeTableBuilder(BumpPtrAllocator &Allocator, bool WriteUnique=true)
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.
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.
ArrayRef< ArrayRef< uint8_t > > records() const
ArrayRef< ArrayRef< uint8_t > > records() const
TypeIndex insertRecordBytes(ArrayRef< uint8_t > &Record)
Expected< TypeIndex > visitTypeEndGetIndex(CVType &Record)