[Alignment][NFC] Use Align with TargetLowering::setMinFunctionAlignment
[llvm-core.git] / include / llvm / DebugInfo / CodeView / SymbolDumper.h
blobd832a48b12653cd94b5a8d5007c49c0b193e5f4b
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 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLDUMPER_H
10 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLDUMPER_H
12 #include "llvm/ADT/ArrayRef.h"
13 #include "llvm/ADT/StringSet.h"
14 #include "llvm/DebugInfo/CodeView/SymbolDumpDelegate.h"
15 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
16 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
18 namespace llvm {
19 class ScopedPrinter;
21 namespace codeview {
22 class TypeCollection;
24 /// Dumper for CodeView symbol streams found in COFF object files and PDB files.
25 class CVSymbolDumper {
26 public:
27 CVSymbolDumper(ScopedPrinter &W, TypeCollection &Types,
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) {}
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.
39 Error dump(CVRecord<SymbolKind> &Record);
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);
45 CPUType getCompilationCPUType() const { return CompilationCPUType; }
47 private:
48 ScopedPrinter &W;
49 TypeCollection &Types;
50 CodeViewContainer Container;
51 std::unique_ptr<SymbolDumpDelegate> ObjDelegate;
52 CPUType CompilationCPUType;
53 bool PrintRecordBytes;
55 } // end namespace codeview
56 } // end namespace llvm
58 #endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLDUMPER_H