LLVM  14.0.0git
ContinuationRecordBuilder.h
Go to the documentation of this file.
1 //===- ContinuationRecordBuilder.h ------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_DEBUGINFO_CODEVIEW_CONTINUATIONRECORDBUILDER_H
10 #define LLVM_DEBUGINFO_CODEVIEW_CONTINUATIONRECORDBUILDER_H
11 
12 #include "llvm/ADT/ArrayRef.h"
13 #include "llvm/ADT/Optional.h"
14 #include "llvm/ADT/SmallVector.h"
23 #include "llvm/Support/Error.h"
24 #include <cassert>
25 #include <cstdint>
26 #include <memory>
27 #include <vector>
28 
29 namespace llvm {
30 namespace codeview {
32 
34  SmallVector<uint32_t, 4> SegmentOffsets;
37  BinaryStreamWriter SegmentWriter;
38  TypeRecordMapping Mapping;
39  ArrayRef<uint8_t> InjectedSegmentBytes;
40 
41  uint32_t getCurrentSegmentLength() const;
42 
43  void insertSegmentEnd(uint32_t Offset);
44  CVType createSegmentRecord(uint32_t OffBegin, uint32_t OffEnd,
45  Optional<TypeIndex> RefersTo);
46 
47 public:
50 
51  void begin(ContinuationRecordKind RecordKind);
52 
53  // This template is explicitly instantiated in the implementation file for all
54  // supported types. The method itself is ugly, so inlining it into the header
55  // file clutters an otherwise straightforward interface.
56  template <typename RecordType> void writeMemberType(RecordType &Record);
57 
58  std::vector<CVType> end(TypeIndex Index);
59 };
60 } // namespace codeview
61 } // namespace llvm
62 
63 #endif
llvm::codeview::ContinuationRecordBuilder::end
std::vector< CVType > end(TypeIndex Index)
Definition: ContinuationRecordBuilder.cpp:173
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
Optional.h
RecordSerialization.h
llvm::codeview::ContinuationRecordKind
ContinuationRecordKind
Definition: ContinuationRecordBuilder.h:31
BinaryByteStream.h
llvm::BinaryStreamWriter
Provides write only access to a subclass of WritableBinaryStream.
Definition: BinaryStreamWriter.h:31
llvm::SmallVector< uint32_t, 4 >
llvm::codeview::TypeRecordMapping
Definition: TypeRecordMapping.h:23
Error.h
TypeVisitorCallbacks.h
llvm::Optional< ContinuationRecordKind >
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::codeview::ContinuationRecordBuilder::writeMemberType
void writeMemberType(RecordType &Record)
Definition: ContinuationRecordBuilder.cpp:78
llvm::codeview::ContinuationRecordBuilder::~ContinuationRecordBuilder
~ContinuationRecordBuilder()
Definition: ContinuationRecordBuilder.cpp:49
llvm::codeview::ContinuationRecordKind::MethodOverloadList
@ MethodOverloadList
llvm::AppendingBinaryByteStream
An implementation of WritableBinaryStream which can write at its end causing the underlying data to g...
Definition: BinaryByteStream.h:135
CodeView.h
llvm::codeview::ContinuationRecordBuilder
Definition: ContinuationRecordBuilder.h:33
Index
uint32_t Index
Definition: ELFObjHandler.cpp:84
llvm::codeview::ContinuationRecordBuilder::begin
void begin(ContinuationRecordKind RecordKind)
Definition: ContinuationRecordBuilder.cpp:51
TypeRecord.h
TypeRecordMapping.h
llvm::codeview::ContinuationRecordKind::FieldList
@ FieldList
ArrayRef.h
llvm::Record
Definition: Record.h:1472
llvm::ArrayRef< uint8_t >
llvm::codeview::CVRecord< TypeLeafKind >
uint32_t
TypeIndex.h
SmallVector.h
llvm::codeview::ContinuationRecordBuilder::ContinuationRecordBuilder
ContinuationRecordBuilder()
Definition: ContinuationRecordBuilder.cpp:46
llvm::codeview::TypeIndex
A 32-bit type reference.
Definition: TypeIndex.h:95
BinaryStreamWriter.h
RecordType
FunctionLoweringInfo::StatepointRelocationRecord RecordType
Definition: StatepointLowering.cpp:75