2016-06-07 04:37:05 +08:00
|
|
|
//===- PdbYAML.cpp -------------------------------------------- *- C++ --*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "PdbYaml.h"
|
|
|
|
|
|
|
|
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
|
|
|
|
|
|
|
|
using namespace llvm;
|
2016-06-07 04:37:17 +08:00
|
|
|
using namespace llvm::yaml;
|
2016-06-07 04:37:05 +08:00
|
|
|
using namespace llvm::pdb;
|
|
|
|
using namespace llvm::pdb::yaml;
|
|
|
|
|
2016-06-07 04:37:17 +08:00
|
|
|
void MappingTraits<MsfHeaders>::mapping(IO &IO, MsfHeaders &Obj) {
|
2016-06-15 02:51:35 +08:00
|
|
|
IO.mapRequired("BlockSize", Obj.BlockSize);
|
|
|
|
IO.mapRequired("Unknown0", Obj.Unknown0);
|
|
|
|
IO.mapRequired("NumBlocks", Obj.BlockCount);
|
|
|
|
IO.mapRequired("NumDirectoryBytes", Obj.NumDirectoryBytes);
|
|
|
|
IO.mapRequired("Unknown1", Obj.Unknown1);
|
|
|
|
IO.mapRequired("BlockMapAddr", Obj.BlockMapIndex);
|
2016-06-07 04:37:05 +08:00
|
|
|
IO.mapRequired("NumDirectoryBlocks", Obj.NumDirectoryBlocks);
|
|
|
|
IO.mapRequired("BlockMapOffset", Obj.BlockMapOffset);
|
|
|
|
IO.mapRequired("DirectoryBlocks", Obj.DirectoryBlocks);
|
|
|
|
IO.mapRequired("NumStreams", Obj.NumStreams);
|
|
|
|
}
|
|
|
|
|
2016-06-07 04:37:17 +08:00
|
|
|
void MappingTraits<PdbObject>::mapping(IO &IO, PdbObject &Obj) {
|
2016-06-07 04:37:05 +08:00
|
|
|
IO.mapOptional("MSF", Obj.Headers);
|
2016-06-07 04:37:17 +08:00
|
|
|
IO.mapOptional("StreamSizes", Obj.StreamSizes);
|
|
|
|
IO.mapOptional("StreamMap", Obj.StreamMap);
|
|
|
|
}
|
2016-06-15 02:51:35 +08:00
|
|
|
|
|
|
|
void MappingTraits<StreamSizeEntry>::mapping(IO &IO, StreamSizeEntry &Obj) {
|
|
|
|
IO.mapRequired("Size", Obj.Size);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MappingTraits<StreamMapEntry>::mapping(IO &IO, StreamMapEntry &Obj) {
|
|
|
|
IO.mapRequired("Blocks", Obj.Blocks);
|
|
|
|
}
|