]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/DebugInfo/CodeView/SymbolDumper.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303571, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / DebugInfo / CodeView / SymbolDumper.h
1 //===-- SymbolDumper.h - CodeView symbol 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_SYMBOLDUMPER_H
11 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLDUMPER_H
12
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/ADT/StringSet.h"
15 #include "llvm/DebugInfo/CodeView/SymbolDumpDelegate.h"
16 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
17 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
18
19 namespace llvm {
20 class ScopedPrinter;
21
22 namespace codeview {
23 class TypeCollection;
24
25 /// Dumper for CodeView symbol streams found in COFF object files and PDB files.
26 class CVSymbolDumper {
27 public:
28   CVSymbolDumper(ScopedPrinter &W, TypeCollection &Types,
29                  std::unique_ptr<SymbolDumpDelegate> ObjDelegate,
30                  bool PrintRecordBytes)
31       : W(W), Types(Types), ObjDelegate(std::move(ObjDelegate)),
32         PrintRecordBytes(PrintRecordBytes) {}
33
34   /// Dumps one type record.  Returns false if there was a type parsing error,
35   /// and true otherwise.  This should be called in order, since the dumper
36   /// maintains state about previous records which are necessary for cross
37   /// type references.
38   Error dump(CVRecord<SymbolKind> &Record);
39
40   /// Dumps the type records in Data. Returns false if there was a type stream
41   /// parse error, and true otherwise.
42   Error dump(const CVSymbolArray &Symbols);
43
44 private:
45   ScopedPrinter &W;
46   TypeCollection &Types;
47   std::unique_ptr<SymbolDumpDelegate> ObjDelegate;
48
49   bool PrintRecordBytes;
50 };
51 } // end namespace codeview
52 } // end namespace llvm
53
54 #endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLDUMPER_H