summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2017-05-03 07:29:25 +0000
committerDaniel Jasper <djasper@google.com>2017-05-03 07:29:25 +0000
commitdff096f217542fc12a69c228536d5b555cb23912 (patch)
treee47fed572e4212072a742d6d684a07f0ef038e45 /llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
parent726701b0ed67c400bc41fe08feb8a19668b59cbf (diff)
downloadbcm5719-llvm-dff096f217542fc12a69c228536d5b555cb23912.tar.gz
bcm5719-llvm-dff096f217542fc12a69c228536d5b555cb23912.zip
Revert r301986 (and subsequent r301987).
The patch is failing to add StringTableStreamBuilder.h, but that isn't even discovered because the corresponding StringTableStreamBuilder.cpp isn't added to any CMakeLists.txt file and thus never built. I think this patch is just incomplete. llvm-svn: 302002
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
index 4dd965c6907..972c995bf4b 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
@@ -80,9 +80,9 @@ Error PDBFileBuilder::addNamedStream(StringRef Name, uint32_t Size) {
}
Expected<msf::MSFLayout> PDBFileBuilder::finalizeMsfLayout() {
- uint32_t StringsLen = Strings.calculateSerializedSize();
+ uint32_t PDBStringTableSize = Strings.finalize();
- if (auto EC = addNamedStream("/names", StringsLen))
+ if (auto EC = addNamedStream("/names", PDBStringTableSize))
return std::move(EC);
if (auto EC = addNamedStream("/LinkInfo", 0))
return std::move(EC);
@@ -109,13 +109,6 @@ Expected<msf::MSFLayout> PDBFileBuilder::finalizeMsfLayout() {
return Msf->build();
}
-Expected<uint32_t> PDBFileBuilder::getNamedStreamIndex(StringRef Name) const {
- uint32_t SN = 0;
- if (!NamedStreams.get(Name, SN))
- return llvm::make_error<pdb::RawError>(raw_error_code::no_stream);
- return SN;
-}
-
Error PDBFileBuilder::commit(StringRef Filename) {
auto ExpectedLayout = finalizeMsfLayout();
if (!ExpectedLayout)
@@ -153,12 +146,12 @@ Error PDBFileBuilder::commit(StringRef Filename) {
return EC;
}
- auto ExpectedSN = getNamedStreamIndex("/names");
- if (!ExpectedSN)
- return ExpectedSN.takeError();
+ uint32_t PDBStringTableStreamNo = 0;
+ if (!NamedStreams.get("/names", PDBStringTableStreamNo))
+ return llvm::make_error<pdb::RawError>(raw_error_code::no_stream);
- auto NS = WritableMappedBlockStream::createIndexedStream(Layout, Buffer,
- *ExpectedSN);
+ auto NS = WritableMappedBlockStream::createIndexedStream(
+ Layout, Buffer, PDBStringTableStreamNo);
BinaryStreamWriter NSWriter(*NS);
if (auto EC = Strings.commit(NSWriter))
return EC;
OpenPOWER on IntegriCloud