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 
28  Error visitTypeBegin(CVType &Record) override;
29  Error visitTypeEnd(CVType &Record) override;
30 
31  Error visitMemberBegin(CVMemberRecord &Record) override;
32  Error visitMemberEnd(CVMemberRecord &Record) override;
33 
34 #define TYPE_RECORD(EnumName, EnumVal, Name) \
35  Error visitKnownRecord(CVType &CVR, Name##Record &Record) override;
36 #define MEMBER_RECORD(EnumName, EnumVal, Name) \
37  Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record) override;
38 #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
39 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
40 #include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
41 
42 private:
43  Optional<TypeLeafKind> TypeKind;
44  Optional<TypeLeafKind> MemberKind;
45 
46  CodeViewRecordIO IO;
47 };
48 }
49 }
50 
51 #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.
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.
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