]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/llvm-pdbdump/CompactTypeDumpVisitor.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303571, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / llvm-pdbdump / CompactTypeDumpVisitor.h
1 //===-- CompactTypeDumpVisitor.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_COMPACTTYPEDUMPVISITOR_H
11 #define LLVM_DEBUGINFO_CODEVIEW_COMPACTTYPEDUMPVISITOR_H
12
13 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
14 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
15 #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
16
17 namespace llvm {
18 class ScopedPrinter;
19 namespace codeview {
20 class TypeCollection;
21 }
22
23 namespace pdb {
24
25 /// Dumper for CodeView type streams found in COFF object files and PDB files.
26 /// Dumps records on a single line, and ignores member records.
27 class CompactTypeDumpVisitor : public codeview::TypeVisitorCallbacks {
28 public:
29   CompactTypeDumpVisitor(codeview::TypeCollection &Types, ScopedPrinter *W);
30   CompactTypeDumpVisitor(codeview::TypeCollection &Types,
31                          codeview::TypeIndex FirstTI, ScopedPrinter *W);
32
33   /// Paired begin/end actions for all types. Receives all record data,
34   /// including the fixed-length record prefix.
35   Error visitTypeBegin(codeview::CVType &Record) override;
36   Error visitTypeEnd(codeview::CVType &Record) override;
37
38 private:
39   ScopedPrinter *W;
40
41   codeview::TypeIndex TI;
42   uint32_t Offset;
43   codeview::TypeCollection &Types;
44 };
45
46 } // end namespace pdb
47 } // end namespace llvm
48
49 #endif