LLVM 22.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
16#include "llvm/Support/Error.h"
17
18#include <memory>
19#include <utility>
20
21namespace llvm {
22class ScopedPrinter;
23
24namespace codeview {
25class TypeCollection;
26
27/// Dumper for CodeView symbol streams found in COFF object files and PDB files.
29public:
31 CodeViewContainer Container,
32 std::unique_ptr<SymbolDumpDelegate> ObjDelegate, CPUType CPU,
33 bool PrintRecordBytes)
34 : W(W), Types(Types), Container(Container),
35 ObjDelegate(std::move(ObjDelegate)), CompilationCPUType(CPU),
36 PrintRecordBytes(PrintRecordBytes) {}
37
38 /// Dumps one type record. Returns false if there was a type parsing error,
39 /// and true otherwise. This should be called in order, since the dumper
40 /// maintains state about previous records which are necessary for cross
41 /// type references.
43
44 /// Dumps the type records in Data. Returns false if there was a type stream
45 /// parse error, and true otherwise.
47
48 CPUType getCompilationCPUType() const { return CompilationCPUType; }
49
50private:
52 TypeCollection &Types;
53 CodeViewContainer Container;
54 std::unique_ptr<SymbolDumpDelegate> ObjDelegate;
55 CPUType CompilationCPUType;
56 bool PrintRecordBytes;
57};
58} // end namespace codeview
59} // end namespace llvm
60
61#endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLDUMPER_H
#define LLVM_ABI
Definition: Compiler.h:213
Lightweight error class with error context and mandatory checking.
Definition: Error.h:159
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:28
CVSymbolDumper(ScopedPrinter &W, TypeCollection &Types, CodeViewContainer Container, std::unique_ptr< SymbolDumpDelegate > ObjDelegate, CPUType CPU, bool PrintRecordBytes)
Definition: SymbolDumper.h:30
LLVM_ABI Error dump(CVRecord< SymbolKind > &Record)
Dumps one type record.
CPUType getCompilationCPUType() const
Definition: SymbolDumper.h:48
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn....
Definition: CodeView.h:77
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:1886
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:851