LLVM  4.0.0
CVTypeDumper.h
Go to the documentation of this file.
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"
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.
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
Dumper for CodeView type streams found in COFF object files and PDB files.
Definition: CVTypeDumper.h:26
print alias Alias Set Printer
A 32-bit type reference.
Definition: TypeIndex.h:89
Error dump(const CVType &Record, TypeVisitorCallbacks &Dumper)
Dumps one type record.
static void printTypeIndex(ScopedPrinter &Printer, StringRef FieldName, TypeIndex TI, TypeDatabase &DB)
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47
CVTypeDumper(TypeDatabase &TypeDB)
Definition: CVTypeDumper.h:28