LLVM  16.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 
20 namespace llvm {
21 class ScopedPrinter;
22 
23 namespace codeview {
24 class TypeCollection;
25 
26 /// Dumper for CodeView symbol streams found in COFF object files and PDB files.
28 public:
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.
45  Error dump(const CVSymbolArray &Symbols);
46 
47  CPUType getCompilationCPUType() const { return CompilationCPUType; }
48 
49 private:
50  ScopedPrinter &W;
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
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
SymbolDumpDelegate.h
Error.h
llvm::VarStreamArray< CVSymbol >
llvm::codeview::TypeCollection
Definition: TypeCollection.h:18
CodeView.h
llvm::codeview::CVSymbolDumper::CVSymbolDumper
CVSymbolDumper(ScopedPrinter &W, TypeCollection &Types, CodeViewContainer Container, std::unique_ptr< SymbolDumpDelegate > ObjDelegate, CPUType CPU, bool PrintRecordBytes)
Definition: SymbolDumper.h:29
llvm::codeview::CVSymbolDumper::dump
Error dump(CVRecord< SymbolKind > &Record)
Dumps one type record.
Definition: SymbolDumper.cpp:651
llvm::codeview::CVSymbolDumper
Dumper for CodeView symbol streams found in COFF object files and PDB files.
Definition: SymbolDumper.h:27
llvm::move
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:1676
llvm::Record
Definition: Record.h:1543
llvm::codeview::CVRecord
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
Definition: CVRecord.h:29
std
Definition: BitVector.h:851
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
CVRecord.h
llvm::ScopedPrinter
Definition: ScopedPrinter.h:100
llvm::codeview::CPUType
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn....
Definition: CodeView.h:78
llvm::codeview::CVSymbolDumper::getCompilationCPUType
CPUType getCompilationCPUType() const
Definition: SymbolDumper.h:47
llvm::codeview::CodeViewContainer
CodeViewContainer
Definition: CodeView.h:612