LLVM  14.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 
12 #include "llvm/ADT/ArrayRef.h"
13 #include "llvm/ADT/StringSet.h"
17 
18 namespace llvm {
19 class ScopedPrinter;
20 
21 namespace codeview {
22 class TypeCollection;
23 
24 /// Dumper for CodeView symbol streams found in COFF object files and PDB files.
26 public:
28  CodeViewContainer Container,
29  std::unique_ptr<SymbolDumpDelegate> ObjDelegate, CPUType CPU,
30  bool PrintRecordBytes)
31  : W(W), Types(Types), Container(Container),
32  ObjDelegate(std::move(ObjDelegate)), CompilationCPUType(CPU),
33  PrintRecordBytes(PrintRecordBytes) {}
34 
35  /// Dumps one type record. Returns false if there was a type parsing error,
36  /// and true otherwise. This should be called in order, since the dumper
37  /// maintains state about previous records which are necessary for cross
38  /// type references.
40 
41  /// Dumps the type records in Data. Returns false if there was a type stream
42  /// parse error, and true otherwise.
43  Error dump(const CVSymbolArray &Symbols);
44 
45  CPUType getCompilationCPUType() const { return CompilationCPUType; }
46 
47 private:
48  ScopedPrinter &W;
49  TypeCollection &Types;
50  CodeViewContainer Container;
51  std::unique_ptr<SymbolDumpDelegate> ObjDelegate;
52  CPUType CompilationCPUType;
53  bool PrintRecordBytes;
54 };
55 } // end namespace codeview
56 } // end namespace llvm
57 
58 #endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLDUMPER_H
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
SymbolDumpDelegate.h
llvm::VarStreamArray< CVSymbol >
llvm::codeview::TypeCollection
Definition: TypeCollection.h:18
llvm::codeview::CVSymbolDumper::CVSymbolDumper
CVSymbolDumper(ScopedPrinter &W, TypeCollection &Types, CodeViewContainer Container, std::unique_ptr< SymbolDumpDelegate > ObjDelegate, CPUType CPU, bool PrintRecordBytes)
Definition: SymbolDumper.h:27
llvm::codeview::CVSymbolDumper::dump
Error dump(CVRecord< SymbolKind > &Record)
Dumps one type record.
Definition: SymbolDumper.cpp:653
ArrayRef.h
llvm::codeview::CVSymbolDumper
Dumper for CodeView symbol streams found in COFF object files and PDB files.
Definition: SymbolDumper.h:25
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:1609
llvm::Record
Definition: Record.h:1472
llvm::codeview::CVRecord
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
Definition: CVRecord.h:29
StringSet.h
std
Definition: BitVector.h:838
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
CVRecord.h
llvm::ScopedPrinter
Definition: ScopedPrinter.h:70
llvm::codeview::CPUType
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn....
Definition: CodeView.h:78
TypeIndex.h
llvm::codeview::CVSymbolDumper::getCompilationCPUType
CPUType getCompilationCPUType() const
Definition: SymbolDumper.h:45
llvm::codeview::CodeViewContainer
CodeViewContainer
Definition: CodeView.h:607