LLVM  4.0.0
TypeDumpVisitor.h
Go to the documentation of this file.
1 //===-- TypeDumpVisitor.h - CodeView type info dumper -----------*- 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_TYPEDUMPVISITOR_H
11 #define LLVM_DEBUGINFO_CODEVIEW_TYPEDUMPVISITOR_H
12 
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/ADT/StringSet.h"
19 
20 namespace llvm {
21 class ScopedPrinter;
22 
23 namespace codeview {
24 
25 /// Dumper for CodeView type streams found in COFF object files and PDB files.
27 public:
28  TypeDumpVisitor(TypeDatabase &TypeDB, ScopedPrinter *W, bool PrintRecordBytes)
29  : W(W), PrintRecordBytes(PrintRecordBytes), TypeDB(TypeDB) {}
30 
31  void printTypeIndex(StringRef FieldName, TypeIndex TI) const;
32 
33  /// Action to take on unknown types. By default, they are ignored.
36 
37  /// Paired begin/end actions for all types. Receives all record data,
38  /// including the fixed-length record prefix.
39  Error visitTypeBegin(CVType &Record) override;
40  Error visitTypeEnd(CVType &Record) override;
43 
44 #define TYPE_RECORD(EnumName, EnumVal, Name) \
45  Error visitKnownRecord(CVType &CVR, Name##Record &Record) override;
46 #define MEMBER_RECORD(EnumName, EnumVal, Name) \
47  Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record) override;
48 #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
49 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
50 #include "TypeRecords.def"
51 
52 private:
53  void printMemberAttributes(MemberAttributes Attrs);
54  void printMemberAttributes(MemberAccess Access, MethodKind Kind,
55  MethodOptions Options);
56 
57  ScopedPrinter *W;
58 
59  bool PrintRecordBytes = false;
60 
61  TypeDatabase &TypeDB;
62 };
63 
64 } // end namespace codeview
65 } // end namespace llvm
66 
67 #endif
Error visitTypeEnd(CVType &Record) override
Error visitUnknownType(CVType &Record) override
Action to take on unknown types. By default, they are ignored.
TypeDumpVisitor(TypeDatabase &TypeDB, ScopedPrinter *W, bool PrintRecordBytes)
A 32-bit type reference.
Definition: TypeIndex.h:89
MethodKind
Part of member attribute flags. (CV_methodprop_e)
Definition: CodeView.h:255
Error visitTypeBegin(CVType &Record) override
Paired begin/end actions for all types.
Error visitUnknownMember(CVMemberRecord &Record) override
void printTypeIndex(StringRef FieldName, TypeIndex TI) const
Error visitMemberBegin(CVMemberRecord &Record) override
MethodOptions
Equivalent to CV_fldattr_t bitfield.
Definition: CodeView.h:266
Dumper for CodeView type streams found in COFF object files and PDB files.
const unsigned Kind
MemberAccess
Source-level access specifier. (CV_access_e)
Definition: CodeView.h:247
Lightweight error class with error context and mandatory checking.
Error visitMemberEnd(CVMemberRecord &Record) override
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47