Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:39

0001 //===- ContinuationRecordBuilder.h ------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
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   // This template is explicitly instantiated in the implementation file for all
0047   // supported types.  The method itself is ugly, so inlining it into the header
0048   // file clutters an otherwise straightforward interface.
0049   template <typename RecordType> void writeMemberType(RecordType &Record);
0050 
0051   std::vector<CVType> end(TypeIndex Index);
0052 };
0053 } // namespace codeview
0054 } // namespace llvm
0055 
0056 #endif