diff options
author | Zachary Turner <zturner@google.com> | 2016-07-15 22:16:56 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-07-15 22:16:56 +0000 |
commit | faa554b2fd6c327cb9cc0ac9983bd3c178f2276c (patch) | |
tree | 7cb1be7bc7dfee1244fb8d6767036955aa276875 /llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp | |
parent | 93be6e8c0ada7f77b93db16c81b2160f82780ae6 (diff) | |
download | llvm-faa554b2fd6c327cb9cc0ac9983bd3c178f2276c.zip llvm-faa554b2fd6c327cb9cc0ac9983bd3c178f2276c.tar.gz llvm-faa554b2fd6c327cb9cc0ac9983bd3c178f2276c.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp new file mode 100644 index 0000000..fe033c3 --- /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<std::unique_ptr<NameMap>> NameMapBuilder::build() { + return llvm::make_unique<NameMap>(); +} + +uint32_t NameMapBuilder::calculateSerializedLength() const { + // For now we write an empty name map, nothing else. + return 5 * sizeof(uint32_t); +} |