blob: b9a8d8f6ac020dc1e8f4506d77c3279ca0b01955 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===- PDBExtras.h - helper functions and classes for PDBs ------*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// 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
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01006//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_DEBUGINFO_PDB_PDBEXTRAS_H
10#define LLVM_DEBUGINFO_PDB_PDBEXTRAS_H
11
12#include "llvm/DebugInfo/CodeView/CodeView.h"
13#include "llvm/DebugInfo/PDB/PDBTypes.h"
Andrew Scull0372a572018-11-16 15:47:06 +000014#include "llvm/Support/raw_ostream.h"
15
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010016#include <unordered_map>
17
18namespace llvm {
19
20class raw_ostream;
21
22namespace pdb {
23
24using TagStats = std::unordered_map<PDB_SymType, int>;
25
26raw_ostream &operator<<(raw_ostream &OS, const PDB_VariantType &Value);
27raw_ostream &operator<<(raw_ostream &OS, const PDB_CallingConv &Conv);
Andrew Scull0372a572018-11-16 15:47:06 +000028raw_ostream &operator<<(raw_ostream &OS, const PDB_BuiltinType &Type);
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010029raw_ostream &operator<<(raw_ostream &OS, const PDB_DataKind &Data);
30raw_ostream &operator<<(raw_ostream &OS, const codeview::RegisterId &Reg);
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);
39raw_ostream &operator<<(raw_ostream &OS,
40 const PDB_SourceCompression &Compression);
41
42raw_ostream &operator<<(raw_ostream &OS, const Variant &Value);
43raw_ostream &operator<<(raw_ostream &OS, const VersionInfo &Version);
44raw_ostream &operator<<(raw_ostream &OS, const TagStats &Stats);
45
Andrew Scull0372a572018-11-16 15:47:06 +000046
47template <typename T>
48void dumpSymbolField(raw_ostream &OS, StringRef Name, T Value, int Indent) {
49 OS << "\n";
50 OS.indent(Indent);
51 OS << Name << ": " << Value;
52}
53
54
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010055} // end namespace pdb
56
57} // end namespace llvm
58
59#endif // LLVM_DEBUGINFO_PDB_PDBEXTRAS_H