LLVM 20.0.0git
TypeRecordMapping.h
Go to the documentation of this file.
1//===- TypeRecordMapping.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_TYPERECORDMAPPING_H
10#define LLVM_DEBUGINFO_CODEVIEW_TYPERECORDMAPPING_H
11
16#include "llvm/Support/Error.h"
17#include <optional>
18
19namespace llvm {
20class BinaryStreamReader;
21class BinaryStreamWriter;
22
23namespace codeview {
24class TypeIndex;
25struct CVMemberRecord;
27public:
28 explicit TypeRecordMapping(BinaryStreamReader &Reader) : IO(Reader) {}
29 explicit TypeRecordMapping(BinaryStreamWriter &Writer) : IO(Writer) {}
30 explicit TypeRecordMapping(CodeViewRecordStreamer &Streamer) : IO(Streamer) {}
31
36
39
40#define TYPE_RECORD(EnumName, EnumVal, Name) \
41 Error visitKnownRecord(CVType &CVR, Name##Record &Record) override;
42#define MEMBER_RECORD(EnumName, EnumVal, Name) \
43 Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record) override;
44#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
45#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
46#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
47
48private:
49 std::optional<TypeLeafKind> TypeKind;
50 std::optional<TypeLeafKind> MemberKind;
51
52 CodeViewRecordIO IO;
53};
54}
55}
56
57#endif
uint32_t Index
Provides read only access to a subclass of BinaryStream.
Provides write only access to a subclass of WritableBinaryStream.
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
A 32-bit type reference.
Definition: TypeIndex.h:96
Error visitTypeBegin(CVType &Record) override
Paired begin/end actions for all types.
Error visitMemberBegin(CVMemberRecord &Record) override
Error visitTypeEnd(CVType &Record) override
Error visitMemberEnd(CVMemberRecord &Record) override
TypeRecordMapping(CodeViewRecordStreamer &Streamer)
TypeRecordMapping(BinaryStreamWriter &Writer)
TypeRecordMapping(BinaryStreamReader &Reader)
virtual Error visitTypeBegin(CVType &Record)
Paired begin/end actions for all types.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18