1 //===- PdbYAML.h ---------------------------------------------- *- C++ --*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H
11 #define LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H
13 #include "OutputStyle.h"
15 #include "llvm/ADT/Optional.h"
16 #include "llvm/DebugInfo/PDB/PDBTypes.h"
17 #include "llvm/DebugInfo/PDB/Raw/MsfCommon.h"
18 #include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
19 #include "llvm/DebugInfo/PDB/Raw/RawConstants.h"
20 #include "llvm/Support/Endian.h"
21 #include "llvm/Support/YAMLTraits.h"
30 msf::SuperBlock SuperBlock;
31 uint32_t NumDirectoryBlocks;
32 std::vector<uint32_t> DirectoryBlocks;
37 struct StreamBlockList {
38 std::vector<uint32_t> Blocks;
41 struct NamedStreamMapping {
43 uint32_t StreamNumber;
46 struct PdbInfoStream {
47 PdbRaw_ImplVer Version;
51 std::vector<NamedStreamMapping> NamedStreams;
55 PdbRaw_DbiVer VerHeader;
58 uint32_t PdbDllVersion;
61 PDB_Machine MachineType;
65 Optional<MsfHeaders> Headers;
66 Optional<std::vector<uint32_t>> StreamSizes;
67 Optional<std::vector<StreamBlockList>> StreamMap;
68 Optional<PdbInfoStream> PdbStream;
69 Optional<PdbDbiStream> DbiStream;
78 template <> struct MappingTraits<pdb::yaml::PdbObject> {
79 static void mapping(IO &IO, pdb::yaml::PdbObject &Obj);
82 template <> struct MappingTraits<pdb::yaml::MsfHeaders> {
83 static void mapping(IO &IO, pdb::yaml::MsfHeaders &Obj);
86 template <> struct MappingTraits<pdb::msf::SuperBlock> {
87 static void mapping(IO &IO, pdb::msf::SuperBlock &SB);
90 template <> struct MappingTraits<pdb::yaml::StreamBlockList> {
91 static void mapping(IO &IO, pdb::yaml::StreamBlockList &SB);
94 template <> struct MappingTraits<pdb::yaml::PdbInfoStream> {
95 static void mapping(IO &IO, pdb::yaml::PdbInfoStream &Obj);
98 template <> struct MappingTraits<pdb::yaml::PdbDbiStream> {
99 static void mapping(IO &IO, pdb::yaml::PdbDbiStream &Obj);
102 template <> struct MappingTraits<pdb::yaml::NamedStreamMapping> {
103 static void mapping(IO &IO, pdb::yaml::NamedStreamMapping &Obj);
108 LLVM_YAML_IS_SEQUENCE_VECTOR(uint32_t)
109 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::NamedStreamMapping)
110 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::StreamBlockList)
112 #endif // LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H