LLVM  9.0.0svn
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 
12 #include "llvm/ADT/Optional.h"
15 #include "llvm/Support/Error.h"
16 
17 namespace llvm {
18 class BinaryStreamReader;
19 class BinaryStreamWriter;
20 
21 namespace codeview {
23 public:
24  explicit TypeRecordMapping(BinaryStreamReader &Reader) : IO(Reader) {}
25  explicit TypeRecordMapping(BinaryStreamWriter &Writer) : IO(Writer) {}
26  explicit TypeRecordMapping(CodeViewRecordStreamer &Streamer) : IO(Streamer) {}
27 
29  Error visitTypeBegin(CVType &Record) override;
30  Error visitTypeBegin(CVType &Record, TypeIndex Index) override;
31  Error visitTypeEnd(CVType &Record) override;
32 
33  Error visitMemberBegin(CVMemberRecord &Record) override;
34  Error visitMemberEnd(CVMemberRecord &Record) override;
35 
36 #define TYPE_RECORD(EnumName, EnumVal, Name) \
37  Error visitKnownRecord(CVType &CVR, Name##Record &Record) override;
38 #define MEMBER_RECORD(EnumName, EnumVal, Name) \
39  Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record) override;
40 #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
41 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
42 #include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
43 
44 private:
45  Optional<TypeLeafKind> TypeKind;
46  Optional<TypeLeafKind> MemberKind;
47 
48  CodeViewRecordIO IO;
49 };
50 }
51 }
52 
53 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:23
Error visitMemberEnd(CVMemberRecord &Record) override
Error visitTypeEnd(CVType &Record) override
Error visitTypeBegin(CVType &Record) override
Paired begin/end actions for all types.
A 32-bit type reference.
Definition: TypeIndex.h:95
Provides write only access to a subclass of WritableBinaryStream.
TypeRecordMapping(BinaryStreamReader &Reader)
TypeRecordMapping(BinaryStreamWriter &Writer)
virtual Error visitTypeBegin(CVType &Record)
Paired begin/end actions for all types.
TypeRecordMapping(CodeViewRecordStreamer &Streamer)
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
Provides read only access to a subclass of BinaryStream.
Error visitMemberBegin(CVMemberRecord &Record) override