1 //===-- CVTypeDumper.h - CodeView type info dumper --------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_CODEVIEW_CVTYPEDUMPER_H
11 #define LLVM_DEBUGINFO_CODEVIEW_CVTYPEDUMPER_H
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"
25 /// Dumper for CodeView type streams found in COFF object files and PDB files.
28 explicit CVTypeDumper(TypeDatabase &TypeDB) : TypeDB(TypeDB) {}
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
34 Error dump(const CVType &Record, TypeVisitorCallbacks &Dumper);
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);
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
44 Error dump(ArrayRef<uint8_t> Data, TypeVisitorCallbacks &Dumper);
46 static void printTypeIndex(ScopedPrinter &Printer, StringRef FieldName,
47 TypeIndex TI, TypeDatabase &DB);
53 } // end namespace codeview
54 } // end namespace llvm
56 #endif // LLVM_DEBUGINFO_CODEVIEW_TYPEDUMPER_H