summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-07-06 18:05:57 +0000
committerZachary Turner <zturner@google.com>2016-07-06 18:05:57 +0000
commit8848a7a6b253b9bba64283d4d754c2b52138c48a (patch)
treecfd03e61893308c413012debf91315424ec968c4 /llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp
parent2ebe18b6098ea7ba78bba54c633d9c6c3357d786 (diff)
downloadbcm5719-llvm-8848a7a6b253b9bba64283d4d754c2b52138c48a.tar.gz
bcm5719-llvm-8848a7a6b253b9bba64283d4d754c2b52138c48a.zip
[pdb] Round trip the PDB stream between YAML and binary PDB.
This gets writing of the PDB stream working. llvm-svn: 274647
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp b/llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp
index 51ec66a1b9d..3638380eb22 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp
@@ -10,9 +10,11 @@
#include "llvm/DebugInfo/PDB/Raw/NameMap.h"
#include "llvm/ADT/SparseBitVector.h"
#include "llvm/DebugInfo/CodeView/StreamReader.h"
+#include "llvm/DebugInfo/CodeView/StreamWriter.h"
#include "llvm/DebugInfo/PDB/Raw/RawError.h"
using namespace llvm;
+using namespace llvm::codeview;
using namespace llvm::pdb;
NameMap::NameMap() {}
@@ -143,6 +145,24 @@ Error NameMap::load(codeview::StreamReader &Stream) {
return Error::success();
}
+Error NameMap::commit(codeview::StreamWriter &Writer) {
+ if (auto EC = Writer.writeInteger(0U)) // Number of bytes in table
+ return EC;
+
+ if (auto EC = Writer.writeInteger(0U)) // Hash Size
+ return EC;
+
+ if (auto EC = Writer.writeInteger(0U)) // Max Number of Strings
+ return EC;
+
+ if (auto EC = Writer.writeInteger(0U)) // Num Present Words
+ return EC;
+
+ if (auto EC = Writer.writeInteger(0U)) // Num Deleted Words
+ return EC;
+ return Error::success();
+}
+
iterator_range<StringMapConstIterator<uint32_t>> NameMap::entries() const {
return llvm::make_range<StringMapConstIterator<uint32_t>>(Mapping.begin(),
Mapping.end());
OpenPOWER on IntegriCloud