]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/DebugInfo/CodeView/CVTypeDumper.h
Merge llvm, clang, lld and lldb release_40 branch r292009. Also update
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / DebugInfo / CodeView / CVTypeDumper.h
1 //===-- CVTypeDumper.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_CVTYPEDUMPER_H
11 #define LLVM_DEBUGINFO_CODEVIEW_CVTYPEDUMPER_H
12
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/ADT/StringSet.h"
15 #include "llvm/DebugInfo/CodeView/TypeDatabase.h"
16 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
17 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
18 #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
19 #include "llvm/Support/ScopedPrinter.h"
20
21 namespace llvm {
22
23 namespace codeview {
24
25 /// Dumper for CodeView type streams found in COFF object files and PDB files.
26 class CVTypeDumper {
27 public:
28   explicit CVTypeDumper(TypeDatabase &TypeDB) : TypeDB(TypeDB) {}
29
30   /// Dumps one type record.  Returns false if there was a type parsing error,
31   /// and true otherwise.  This should be called in order, since the dumper
32   /// maintains state about previous records which are necessary for cross
33   /// type references.
34   Error dump(const CVType &Record, TypeVisitorCallbacks &Dumper);
35
36   /// Dumps the type records in Types. Returns false if there was a type stream
37   /// parse error, and true otherwise.
38   Error dump(const CVTypeArray &Types, TypeVisitorCallbacks &Dumper);
39
40   /// Dumps the type records in Data. Returns false if there was a type stream
41   /// parse error, and true otherwise. Use this method instead of the
42   /// CVTypeArray overload when type records are laid out contiguously in
43   /// memory.
44   Error dump(ArrayRef<uint8_t> Data, TypeVisitorCallbacks &Dumper);
45
46   static void printTypeIndex(ScopedPrinter &Printer, StringRef FieldName,
47                              TypeIndex TI, TypeDatabase &DB);
48
49 private:
50   TypeDatabase &TypeDB;
51 };
52
53 } // end namespace codeview
54 } // end namespace llvm
55
56 #endif // LLVM_DEBUGINFO_CODEVIEW_TYPEDUMPER_H