LLVM  6.0.0svn
TypeRecordMapping.h
Go to the documentation of this file.
1 //===- TypeRecordMapping.h --------------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_DEBUGINFO_CODEVIEW_TYPERECORDMAPPING_H
11 #define LLVM_DEBUGINFO_CODEVIEW_TYPERECORDMAPPING_H
12 
13 #include "llvm/ADT/Optional.h"
16 #include "llvm/Support/Error.h"
17 
18 namespace llvm {
19 class BinaryStreamReader;
20 class BinaryStreamWriter;
21 
22 namespace codeview {
24 public:
25  explicit TypeRecordMapping(BinaryStreamReader &Reader) : IO(Reader) {}
26  explicit TypeRecordMapping(BinaryStreamWriter &Writer) : IO(Writer) {}
27 
29  Error visitTypeBegin(CVType &Record) override;
30  Error visitTypeEnd(CVType &Record) override;
31 
32  Error visitMemberBegin(CVMemberRecord &Record) override;
33  Error visitMemberEnd(CVMemberRecord &Record) override;
34 
35 #define TYPE_RECORD(EnumName, EnumVal, Name) \
36  Error visitKnownRecord(CVType &CVR, Name##Record &Record) override;
37 #define MEMBER_RECORD(EnumName, EnumVal, Name) \
38  Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record) override;
39 #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
40 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
41 #include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
42 
43 private:
44  Optional<TypeLeafKind> TypeKind;
45  Optional<TypeLeafKind> MemberKind;
46 
47  CodeViewRecordIO IO;
48 };
49 }
50 }
51 
52 #endif
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
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:156
Provides read only access to a subclass of BinaryStream.
Error visitMemberBegin(CVMemberRecord &Record) override