LLVM 22.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
17#include "llvm/Support/Error.h"
18#include <optional>
19
20namespace llvm {
21class BinaryStreamReader;
22class BinaryStreamWriter;
23
24namespace codeview {
25class TypeIndex;
26struct CVMemberRecord;
28public:
29 explicit TypeRecordMapping(BinaryStreamReader &Reader) : IO(Reader) {}
30 explicit TypeRecordMapping(BinaryStreamWriter &Writer) : IO(Writer) {}
31 explicit TypeRecordMapping(CodeViewRecordStreamer &Streamer) : IO(Streamer) {}
32
33 using TypeVisitorCallbacks::visitTypeBegin;
34 Error visitTypeBegin(CVType &Record) override;
35 Error visitTypeBegin(CVType &Record, TypeIndex Index) override;
36 Error visitTypeEnd(CVType &Record) override;
37
38 Error visitMemberBegin(CVMemberRecord &Record) override;
39 Error visitMemberEnd(CVMemberRecord &Record) override;
40
41#define TYPE_RECORD(EnumName, EnumVal, Name) \
42 Error visitKnownRecord(CVType &CVR, Name##Record &Record) override;
43#define MEMBER_RECORD(EnumName, EnumVal, Name) \
44 Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record) override;
45#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
46#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
47#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
48
49private:
50 std::optional<TypeLeafKind> TypeKind;
51 std::optional<TypeLeafKind> MemberKind;
52
53 CodeViewRecordIO IO;
54};
55}
56}
57
58#endif
#define LLVM_ABI
Definition: Compiler.h:213
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:159
A 32-bit type reference.
Definition: TypeIndex.h:97
TypeRecordMapping(CodeViewRecordStreamer &Streamer)
TypeRecordMapping(BinaryStreamWriter &Writer)
TypeRecordMapping(BinaryStreamReader &Reader)
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18