LLVM  4.0.0
TypeDatabaseVisitor.h
Go to the documentation of this file.
1 //===-- TypeDatabaseVisitor.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_TYPEDATABASEVISITOR_H
11 #define LLVM_DEBUGINFO_CODEVIEW_TYPEDATABASEVISITOR_H
12 
17 
18 namespace llvm {
19 namespace codeview {
20 
21 /// Dumper for CodeView type streams found in COFF object files and PDB files.
23 public:
24  explicit TypeDatabaseVisitor(TypeDatabase &TypeDB) : TypeDB(TypeDB) {}
25 
26  /// Paired begin/end actions for all types. Receives all record data,
27  /// including the fixed-length record prefix.
28  Error visitTypeBegin(CVType &Record) override;
29  Error visitTypeEnd(CVType &Record) override;
32 
33 #define TYPE_RECORD(EnumName, EnumVal, Name) \
34  Error visitKnownRecord(CVType &CVR, Name##Record &Record) override;
35 #define MEMBER_RECORD(EnumName, EnumVal, Name) \
36  Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record) override;
37 #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
38 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
39 #include "TypeRecords.def"
40 
41 private:
42  bool IsInFieldList = false;
43 
44  /// Name of the current type. Only valid before visitTypeEnd.
45  StringRef Name;
46 
47  TypeDatabase &TypeDB;
48 };
49 
50 } // end namespace codeview
51 } // end namespace llvm
52 
53 #endif // LLVM_DEBUGINFO_CODEVIEW_TYPEDUMPER_H
Error visitTypeEnd(CVType &Record) override
Error visitTypeBegin(CVType &Record) override
Paired begin/end actions for all types.
Error visitMemberBegin(CVMemberRecord &Record) override
Dumper for CodeView type streams found in COFF object files and PDB files.
Error visitMemberEnd(CVMemberRecord &Record) override
Lightweight error class with error context and mandatory checking.