1//===- PDBExtras.h - helper functions and classes for PDBs ------*- 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_PDB_PDBEXTRAS_H
10#define LLVM_DEBUGINFO_PDB_PDBEXTRAS_H
11
12#include "llvm/ADT/StringRef.h"
13#include "llvm/DebugInfo/CodeView/CodeView.h"
14#include "llvm/DebugInfo/PDB/PDBTypes.h"
15#include "llvm/Support/raw_ostream.h"
16#include <cstdint>
17#include <unordered_map>
18
19namespace llvm {
20
21namespace pdb {
22
23using TagStats = std::unordered_map<PDB_SymType, int>;
24
25raw_ostream &operator<<(raw_ostream &OS, const PDB_VariantType &Value);
26raw_ostream &operator<<(raw_ostream &OS, const PDB_CallingConv &Conv);
27raw_ostream &operator<<(raw_ostream &OS, const PDB_BuiltinType &Type);
28raw_ostream &operator<<(raw_ostream &OS, const PDB_DataKind &Data);
29raw_ostream &operator<<(raw_ostream &OS,
30 const llvm::codeview::CPURegister &CpuReg);
31raw_ostream &operator<<(raw_ostream &OS, const PDB_LocType &Loc);
32raw_ostream &operator<<(raw_ostream &OS, const codeview::ThunkOrdinal &Thunk);
33raw_ostream &operator<<(raw_ostream &OS, const PDB_Checksum &Checksum);
34raw_ostream &operator<<(raw_ostream &OS, const PDB_Lang &Lang);
35raw_ostream &operator<<(raw_ostream &OS, const PDB_SymType &Tag);
36raw_ostream &operator<<(raw_ostream &OS, const PDB_MemberAccess &Access);
37raw_ostream &operator<<(raw_ostream &OS, const PDB_UdtType &Type);
38raw_ostream &operator<<(raw_ostream &OS, const PDB_Machine &Machine);
39
40raw_ostream &operator<<(raw_ostream &OS, const Variant &Value);
41raw_ostream &operator<<(raw_ostream &OS, const VersionInfo &Version);
42raw_ostream &operator<<(raw_ostream &OS, const TagStats &Stats);
43
44raw_ostream& dumpPDBSourceCompression(raw_ostream& OS, uint32_t Compression);
45
46template <typename T>
47void dumpSymbolField(raw_ostream &OS, StringRef Name, T Value, int Indent) {
48 OS << "\n";
49 OS.indent(NumSpaces: Indent);
50 OS << Name << ": " << Value;
51}
52
53} // end namespace pdb
54
55} // end namespace llvm
56
57#endif // LLVM_DEBUGINFO_PDB_PDBEXTRAS_H
58

source code of llvm/include/llvm/DebugInfo/PDB/PDBExtras.h