blob: aaec71aa8c90da17eb8ebc191cf13fd009cd3cfe [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===- PDBExtras.h - helper functions and classes for PDBs ------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLVM_DEBUGINFO_PDB_PDBEXTRAS_H
11#define LLVM_DEBUGINFO_PDB_PDBEXTRAS_H
12
13#include "llvm/DebugInfo/CodeView/CodeView.h"
14#include "llvm/DebugInfo/PDB/PDBTypes.h"
Andrew Scull0372a572018-11-16 15:47:06 +000015#include "llvm/Support/raw_ostream.h"
16
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010017#include <unordered_map>
18
19namespace llvm {
20
21class raw_ostream;
22
23namespace pdb {
24
25using TagStats = std::unordered_map<PDB_SymType, int>;
26
27raw_ostream &operator<<(raw_ostream &OS, const PDB_VariantType &Value);
28raw_ostream &operator<<(raw_ostream &OS, const PDB_CallingConv &Conv);
Andrew Scull0372a572018-11-16 15:47:06 +000029raw_ostream &operator<<(raw_ostream &OS, const PDB_BuiltinType &Type);
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010030raw_ostream &operator<<(raw_ostream &OS, const PDB_DataKind &Data);
31raw_ostream &operator<<(raw_ostream &OS, const codeview::RegisterId &Reg);
32raw_ostream &operator<<(raw_ostream &OS, const PDB_LocType &Loc);
33raw_ostream &operator<<(raw_ostream &OS, const codeview::ThunkOrdinal &Thunk);
34raw_ostream &operator<<(raw_ostream &OS, const PDB_Checksum &Checksum);
35raw_ostream &operator<<(raw_ostream &OS, const PDB_Lang &Lang);
36raw_ostream &operator<<(raw_ostream &OS, const PDB_SymType &Tag);
37raw_ostream &operator<<(raw_ostream &OS, const PDB_MemberAccess &Access);
38raw_ostream &operator<<(raw_ostream &OS, const PDB_UdtType &Type);
39raw_ostream &operator<<(raw_ostream &OS, const PDB_Machine &Machine);
40raw_ostream &operator<<(raw_ostream &OS,
41 const PDB_SourceCompression &Compression);
42
43raw_ostream &operator<<(raw_ostream &OS, const Variant &Value);
44raw_ostream &operator<<(raw_ostream &OS, const VersionInfo &Version);
45raw_ostream &operator<<(raw_ostream &OS, const TagStats &Stats);
46
Andrew Scull0372a572018-11-16 15:47:06 +000047
48template <typename T>
49void dumpSymbolField(raw_ostream &OS, StringRef Name, T Value, int Indent) {
50 OS << "\n";
51 OS.indent(Indent);
52 OS << Name << ": " << Value;
53}
54
55
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010056} // end namespace pdb
57
58} // end namespace llvm
59
60#endif // LLVM_DEBUGINFO_PDB_PDBEXTRAS_H