LLVM 19.0.0git
SymbolDumper.h
Go to the documentation of this file.
1//===-- SymbolDumper.h - CodeView symbol info dumper ------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLDUMPER_H
10#define LLVM_DEBUGINFO_CODEVIEW_SYMBOLDUMPER_H
11
15#include "llvm/Support/Error.h"
16
17#include <memory>
18#include <utility>
19
20namespace llvm {
21class ScopedPrinter;
22
23namespace codeview {
24class TypeCollection;
25
26/// Dumper for CodeView symbol streams found in COFF object files and PDB files.
28public:
30 CodeViewContainer Container,
31 std::unique_ptr<SymbolDumpDelegate> ObjDelegate, CPUType CPU,
32 bool PrintRecordBytes)
33 : W(W), Types(Types), Container(Container),
34 ObjDelegate(std::move(ObjDelegate)), CompilationCPUType(CPU),
35 PrintRecordBytes(PrintRecordBytes) {}
36
37 /// Dumps one type record. Returns false if there was a type parsing error,
38 /// and true otherwise. This should be called in order, since the dumper
39 /// maintains state about previous records which are necessary for cross
40 /// type references.
42
43 /// Dumps the type records in Data. Returns false if there was a type stream
44 /// parse error, and true otherwise.
46
47 CPUType getCompilationCPUType() const { return CompilationCPUType; }
48
49private:
51 TypeCollection &Types;
52 CodeViewContainer Container;
53 std::unique_ptr<SymbolDumpDelegate> ObjDelegate;
54 CPUType CompilationCPUType;
55 bool PrintRecordBytes;
56};
57} // end namespace codeview
58} // end namespace llvm
59
60#endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLDUMPER_H
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
Definition: CVRecord.h:29
Dumper for CodeView symbol streams found in COFF object files and PDB files.
Definition: SymbolDumper.h:27
CVSymbolDumper(ScopedPrinter &W, TypeCollection &Types, CodeViewContainer Container, std::unique_ptr< SymbolDumpDelegate > ObjDelegate, CPUType CPU, bool PrintRecordBytes)
Definition: SymbolDumper.h:29
Error dump(CVRecord< SymbolKind > &Record)
Dumps one type record.
CPUType getCompilationCPUType() const
Definition: SymbolDumper.h:47
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn....
Definition: CodeView.h:76
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1849
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:858