File indexing completed on 2026-05-10 08:43:39
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_DEBUGINFO_CODEVIEW_CONTINUATIONRECORDBUILDER_H
0010 #define LLVM_DEBUGINFO_CODEVIEW_CONTINUATIONRECORDBUILDER_H
0011
0012 #include "llvm/ADT/ArrayRef.h"
0013 #include "llvm/ADT/SmallVector.h"
0014 #include "llvm/DebugInfo/CodeView/CVRecord.h"
0015 #include "llvm/DebugInfo/CodeView/TypeRecordMapping.h"
0016 #include "llvm/Support/BinaryByteStream.h"
0017 #include "llvm/Support/BinaryStreamWriter.h"
0018 #include <cstdint>
0019 #include <vector>
0020
0021 namespace llvm {
0022 namespace codeview {
0023 class TypeIndex;
0024 enum class ContinuationRecordKind { FieldList, MethodOverloadList };
0025
0026 class ContinuationRecordBuilder {
0027 SmallVector<uint32_t, 4> SegmentOffsets;
0028 std::optional<ContinuationRecordKind> Kind;
0029 AppendingBinaryByteStream Buffer;
0030 BinaryStreamWriter SegmentWriter;
0031 TypeRecordMapping Mapping;
0032 ArrayRef<uint8_t> InjectedSegmentBytes;
0033
0034 uint32_t getCurrentSegmentLength() const;
0035
0036 void insertSegmentEnd(uint32_t Offset);
0037 CVType createSegmentRecord(uint32_t OffBegin, uint32_t OffEnd,
0038 std::optional<TypeIndex> RefersTo);
0039
0040 public:
0041 ContinuationRecordBuilder();
0042 ~ContinuationRecordBuilder();
0043
0044 void begin(ContinuationRecordKind RecordKind);
0045
0046
0047
0048
0049 template <typename RecordType> void writeMemberType(RecordType &Record);
0050
0051 std::vector<CVType> end(TypeIndex Index);
0052 };
0053 }
0054 }
0055
0056 #endif