1 //===- PDBExtras.cpp - helper functions and classes for PDBs --------------===//
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
7 //===----------------------------------------------------------------------===//
9 #include "llvm/DebugInfo/PDB/PDBExtras.h"
10 #include "llvm/ADT/ArrayRef.h"
11 #include "llvm/Support/raw_ostream.h"
14 using namespace llvm::pdb
;
16 #define CASE_OUTPUT_ENUM_CLASS_STR(Class, Value, Str, Stream) \
21 #define CASE_OUTPUT_ENUM_CLASS_NAME(Class, Value, Stream) \
22 CASE_OUTPUT_ENUM_CLASS_STR(Class, Value, #Value, Stream)
24 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
,
25 const PDB_VariantType
&Type
) {
27 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_VariantType
, Bool
, OS
)
28 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_VariantType
, Single
, OS
)
29 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_VariantType
, Double
, OS
)
30 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_VariantType
, Int8
, OS
)
31 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_VariantType
, Int16
, OS
)
32 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_VariantType
, Int32
, OS
)
33 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_VariantType
, Int64
, OS
)
34 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_VariantType
, UInt8
, OS
)
35 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_VariantType
, UInt16
, OS
)
36 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_VariantType
, UInt32
, OS
)
37 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_VariantType
, UInt64
, OS
)
44 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
,
45 const PDB_BuiltinType
&Type
) {
47 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, None
, OS
)
48 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, Void
, OS
)
49 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, Char
, OS
)
50 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, WCharT
, OS
)
51 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, Int
, OS
)
52 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, UInt
, OS
)
53 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, Float
, OS
)
54 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, BCD
, OS
)
55 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, Bool
, OS
)
56 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, Long
, OS
)
57 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, ULong
, OS
)
58 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, Currency
, OS
)
59 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, Date
, OS
)
60 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, Variant
, OS
)
61 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, Complex
, OS
)
62 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, Bitfield
, OS
)
63 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, BSTR
, OS
)
64 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, HResult
, OS
)
65 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, Char16
, OS
)
66 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_BuiltinType
, Char32
, OS
)
71 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
,
72 const PDB_CallingConv
&Conv
) {
75 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, NearC
, "cdecl", OS
)
76 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, FarC
, "cdecl", OS
)
77 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, NearPascal
, "pascal", OS
)
78 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, FarPascal
, "pascal", OS
)
79 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, NearFast
, "fastcall", OS
)
80 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, FarFast
, "fastcall", OS
)
81 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, NearStdCall
, "stdcall", OS
)
82 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, FarStdCall
, "stdcall", OS
)
83 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, NearSysCall
, "syscall", OS
)
84 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, FarSysCall
, "syscall", OS
)
85 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, ThisCall
, "thiscall", OS
)
86 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, MipsCall
, "mipscall", OS
)
87 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, Generic
, "genericcall", OS
)
88 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, AlphaCall
, "alphacall", OS
)
89 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, PpcCall
, "ppccall", OS
)
90 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, SHCall
, "superhcall", OS
)
91 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, ArmCall
, "armcall", OS
)
92 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, AM33Call
, "am33call", OS
)
93 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, TriCall
, "tricall", OS
)
94 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, SH5Call
, "sh5call", OS
)
95 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, M32RCall
, "m32rcall", OS
)
96 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, ClrCall
, "clrcall", OS
)
97 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, Inline
, "inlinecall", OS
)
98 CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv
, NearVector
, "vectorcall", OS
)
103 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
, const PDB_DataKind
&Data
) {
105 CASE_OUTPUT_ENUM_CLASS_STR(PDB_DataKind
, Unknown
, "unknown", OS
)
106 CASE_OUTPUT_ENUM_CLASS_STR(PDB_DataKind
, Local
, "local", OS
)
107 CASE_OUTPUT_ENUM_CLASS_STR(PDB_DataKind
, StaticLocal
, "static local", OS
)
108 CASE_OUTPUT_ENUM_CLASS_STR(PDB_DataKind
, Param
, "param", OS
)
109 CASE_OUTPUT_ENUM_CLASS_STR(PDB_DataKind
, ObjectPtr
, "this ptr", OS
)
110 CASE_OUTPUT_ENUM_CLASS_STR(PDB_DataKind
, FileStatic
, "static global", OS
)
111 CASE_OUTPUT_ENUM_CLASS_STR(PDB_DataKind
, Global
, "global", OS
)
112 CASE_OUTPUT_ENUM_CLASS_STR(PDB_DataKind
, Member
, "member", OS
)
113 CASE_OUTPUT_ENUM_CLASS_STR(PDB_DataKind
, StaticMember
, "static member", OS
)
114 CASE_OUTPUT_ENUM_CLASS_STR(PDB_DataKind
, Constant
, "const", OS
)
119 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
,
120 const llvm::codeview::CPURegister
&CpuReg
) {
121 if (CpuReg
.Cpu
== llvm::codeview::CPUType::ARM64
) {
122 switch (CpuReg
.Reg
) {
123 #define CV_REGISTERS_ARM64
124 #define CV_REGISTER(name, val) \
125 case codeview::RegisterId::name: \
128 #include "llvm/DebugInfo/CodeView/CodeViewRegisters.def"
130 #undef CV_REGISTERS_ARM64
136 switch (CpuReg
.Reg
) {
137 #define CV_REGISTERS_X86
138 #define CV_REGISTER(name, val) \
139 case codeview::RegisterId::name: \
142 #include "llvm/DebugInfo/CodeView/CodeViewRegisters.def"
144 #undef CV_REGISTERS_X86
150 OS
<< static_cast<int>(CpuReg
.Reg
);
154 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
, const PDB_LocType
&Loc
) {
156 CASE_OUTPUT_ENUM_CLASS_STR(PDB_LocType
, Static
, "static", OS
)
157 CASE_OUTPUT_ENUM_CLASS_STR(PDB_LocType
, TLS
, "tls", OS
)
158 CASE_OUTPUT_ENUM_CLASS_STR(PDB_LocType
, RegRel
, "regrel", OS
)
159 CASE_OUTPUT_ENUM_CLASS_STR(PDB_LocType
, ThisRel
, "thisrel", OS
)
160 CASE_OUTPUT_ENUM_CLASS_STR(PDB_LocType
, Enregistered
, "register", OS
)
161 CASE_OUTPUT_ENUM_CLASS_STR(PDB_LocType
, BitField
, "bitfield", OS
)
162 CASE_OUTPUT_ENUM_CLASS_STR(PDB_LocType
, Slot
, "slot", OS
)
163 CASE_OUTPUT_ENUM_CLASS_STR(PDB_LocType
, IlRel
, "IL rel", OS
)
164 CASE_OUTPUT_ENUM_CLASS_STR(PDB_LocType
, MetaData
, "metadata", OS
)
165 CASE_OUTPUT_ENUM_CLASS_STR(PDB_LocType
, Constant
, "constant", OS
)
166 CASE_OUTPUT_ENUM_CLASS_STR(PDB_LocType
, RegRelAliasIndir
,
167 "regrelaliasindir", OS
)
174 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
,
175 const codeview::ThunkOrdinal
&Thunk
) {
177 CASE_OUTPUT_ENUM_CLASS_NAME(codeview::ThunkOrdinal
, BranchIsland
, OS
)
178 CASE_OUTPUT_ENUM_CLASS_NAME(codeview::ThunkOrdinal
, Pcode
, OS
)
179 CASE_OUTPUT_ENUM_CLASS_NAME(codeview::ThunkOrdinal
, Standard
, OS
)
180 CASE_OUTPUT_ENUM_CLASS_NAME(codeview::ThunkOrdinal
, ThisAdjustor
, OS
)
181 CASE_OUTPUT_ENUM_CLASS_NAME(codeview::ThunkOrdinal
, TrampIncremental
, OS
)
182 CASE_OUTPUT_ENUM_CLASS_NAME(codeview::ThunkOrdinal
, UnknownLoad
, OS
)
183 CASE_OUTPUT_ENUM_CLASS_NAME(codeview::ThunkOrdinal
, Vcall
, OS
)
188 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
,
189 const PDB_Checksum
&Checksum
) {
191 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Checksum
, None
, OS
)
192 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Checksum
, MD5
, OS
)
193 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Checksum
, SHA1
, OS
)
194 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Checksum
, SHA256
, OS
)
199 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
, const PDB_Lang
&Lang
) {
201 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, C
, OS
)
202 CASE_OUTPUT_ENUM_CLASS_STR(PDB_Lang
, Cpp
, "C++", OS
)
203 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, Fortran
, OS
)
204 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, Masm
, OS
)
205 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, Pascal
, OS
)
206 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, Basic
, OS
)
207 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, Cobol
, OS
)
208 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, Link
, OS
)
209 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, Cvtres
, OS
)
210 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, Cvtpgd
, OS
)
211 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, CSharp
, OS
)
212 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, VB
, OS
)
213 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, ILAsm
, OS
)
214 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, Java
, OS
)
215 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, JScript
, OS
)
216 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, MSIL
, OS
)
217 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, HLSL
, OS
)
218 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, D
, OS
)
219 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang
, Swift
, OS
)
224 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
, const PDB_SymType
&Tag
) {
226 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Exe
, OS
)
227 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Compiland
, OS
)
228 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, CompilandDetails
, OS
)
229 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, CompilandEnv
, OS
)
230 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Function
, OS
)
231 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Block
, OS
)
232 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Data
, OS
)
233 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Annotation
, OS
)
234 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Label
, OS
)
235 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, PublicSymbol
, OS
)
236 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, UDT
, OS
)
237 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Enum
, OS
)
238 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, FunctionSig
, OS
)
239 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, PointerType
, OS
)
240 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, ArrayType
, OS
)
241 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, BuiltinType
, OS
)
242 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Typedef
, OS
)
243 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, BaseClass
, OS
)
244 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Friend
, OS
)
245 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, FunctionArg
, OS
)
246 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, FuncDebugStart
, OS
)
247 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, FuncDebugEnd
, OS
)
248 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, UsingNamespace
, OS
)
249 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, VTableShape
, OS
)
250 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, VTable
, OS
)
251 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Custom
, OS
)
252 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Thunk
, OS
)
253 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, CustomType
, OS
)
254 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, ManagedType
, OS
)
255 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Dimension
, OS
)
256 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, CallSite
, OS
)
257 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, InlineSite
, OS
)
258 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, BaseInterface
, OS
)
259 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, VectorType
, OS
)
260 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, MatrixType
, OS
)
261 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, HLSLType
, OS
)
262 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Caller
, OS
)
263 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Callee
, OS
)
264 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Export
, OS
)
265 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, HeapAllocationSite
, OS
)
266 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, CoffGroup
, OS
)
267 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SymType
, Inlinee
, OS
)
269 OS
<< "Unknown SymTag " << uint32_t(Tag
);
274 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
,
275 const PDB_MemberAccess
&Access
) {
277 CASE_OUTPUT_ENUM_CLASS_STR(PDB_MemberAccess
, Public
, "public", OS
)
278 CASE_OUTPUT_ENUM_CLASS_STR(PDB_MemberAccess
, Protected
, "protected", OS
)
279 CASE_OUTPUT_ENUM_CLASS_STR(PDB_MemberAccess
, Private
, "private", OS
)
284 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
, const PDB_UdtType
&Type
) {
286 CASE_OUTPUT_ENUM_CLASS_STR(PDB_UdtType
, Class
, "class", OS
)
287 CASE_OUTPUT_ENUM_CLASS_STR(PDB_UdtType
, Struct
, "struct", OS
)
288 CASE_OUTPUT_ENUM_CLASS_STR(PDB_UdtType
, Interface
, "interface", OS
)
289 CASE_OUTPUT_ENUM_CLASS_STR(PDB_UdtType
, Union
, "union", OS
)
294 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
,
295 const PDB_Machine
&Machine
) {
297 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, Am33
, OS
)
298 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, Amd64
, OS
)
299 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, Arm
, OS
)
300 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, ArmNT
, OS
)
301 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, Ebc
, OS
)
302 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, x86
, OS
)
303 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, Ia64
, OS
)
304 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, M32R
, OS
)
305 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, Mips16
, OS
)
306 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, MipsFpu
, OS
)
307 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, MipsFpu16
, OS
)
308 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, PowerPC
, OS
)
309 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, PowerPCFP
, OS
)
310 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, R4000
, OS
)
311 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, SH3
, OS
)
312 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, SH3DSP
, OS
)
313 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, SH4
, OS
)
314 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, SH5
, OS
)
315 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, Thumb
, OS
)
316 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Machine
, WceMipsV2
, OS
)
323 raw_ostream
&llvm::pdb::dumpPDBSourceCompression(raw_ostream
&OS
,
324 uint32_t Compression
) {
325 switch (Compression
) {
326 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SourceCompression
, None
, OS
)
327 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SourceCompression
, Huffman
, OS
)
328 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SourceCompression
, LZ
, OS
)
329 CASE_OUTPUT_ENUM_CLASS_STR(PDB_SourceCompression
, RunLengthEncoded
, "RLE",
331 CASE_OUTPUT_ENUM_CLASS_NAME(PDB_SourceCompression
, DotNet
, OS
)
333 OS
<< "Unknown (" << Compression
<< ")";
338 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
, const Variant
&Value
) {
339 switch (Value
.Type
) {
340 case PDB_VariantType::Bool
:
341 OS
<< (Value
.Value
.Bool
? "true" : "false");
343 case PDB_VariantType::Double
:
344 OS
<< Value
.Value
.Double
;
346 case PDB_VariantType::Int16
:
347 OS
<< Value
.Value
.Int16
;
349 case PDB_VariantType::Int32
:
350 OS
<< Value
.Value
.Int32
;
352 case PDB_VariantType::Int64
:
353 OS
<< Value
.Value
.Int64
;
355 case PDB_VariantType::Int8
:
356 OS
<< static_cast<int>(Value
.Value
.Int8
);
358 case PDB_VariantType::Single
:
359 OS
<< Value
.Value
.Single
;
361 case PDB_VariantType::UInt16
:
362 OS
<< Value
.Value
.UInt16
;
364 case PDB_VariantType::UInt32
:
365 OS
<< Value
.Value
.UInt32
;
367 case PDB_VariantType::UInt64
:
368 OS
<< Value
.Value
.UInt64
;
370 case PDB_VariantType::UInt8
:
371 OS
<< static_cast<unsigned>(Value
.Value
.UInt8
);
373 case PDB_VariantType::String
:
374 OS
<< Value
.Value
.String
;
382 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
,
383 const VersionInfo
&Version
) {
384 OS
<< Version
.Major
<< "." << Version
.Minor
<< "." << Version
.Build
;
388 raw_ostream
&llvm::pdb::operator<<(raw_ostream
&OS
, const TagStats
&Stats
) {
389 for (auto Tag
: Stats
) {
390 OS
<< Tag
.first
<< ":" << Tag
.second
<< " ";