From faa554b2fd6c327cb9cc0ac9983bd3c178f2276c Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 15 Jul 2016 22:16:56 +0000 Subject: [pdb] Use MsfBuilder to handle the writing PDBs. Previously we would read a PDB, then write some of it back out, but write the directory, super block, and other pertinent metadata back out unchanged. This generates incorrect PDBs since the amount of data written was not always the same as the amount of data read. This patch changes things to use the newly introduced `MsfBuilder` class to write out a correct and accurate set of Msf metadata for the data *actually* written, which opens up the door for adding and removing type records, symbol records, and other types of data to an existing PDB. llvm-svn: 275627 --- llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp (limited to 'llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp') diff --git a/llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp new file mode 100644 index 00000000000..fe033c368e7 --- /dev/null +++ b/llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp @@ -0,0 +1,26 @@ +//===- NameMapBuilder.cpp - PDB Name Map Builder ----------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "llvm/DebugInfo/PDB/Raw/NameMapBuilder.h" + +#include "llvm/DebugInfo/PDB/Raw/NameMap.h" + +using namespace llvm; +using namespace llvm::pdb; + +NameMapBuilder::NameMapBuilder() {} + +Expected> NameMapBuilder::build() { + return llvm::make_unique(); +} + +uint32_t NameMapBuilder::calculateSerializedLength() const { + // For now we write an empty name map, nothing else. + return 5 * sizeof(uint32_t); +} -- cgit v1.2.3