summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-06-12 21:46:51 +0000
committerZachary Turner <zturner@google.com>2017-06-12 21:46:51 +0000
commit68ea80d0a74fa2e5025e424435558407d4711c07 (patch)
treee043cf3282ea9cf698224c875d4940738f1732ca /llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
parent990d0c81587c2d9a3e2338998d551ce73e9a68ad (diff)
downloadbcm5719-llvm-68ea80d0a74fa2e5025e424435558407d4711c07.tar.gz
bcm5719-llvm-68ea80d0a74fa2e5025e424435558407d4711c07.zip
Slightly better fix for dealing with no-id-stream PDBs.
The last fix required the user to manually add the required feature. This caused an LLD test to fail because I failed to update LLD. In practice we can hide this logic so it can just be transparently added when we write the PDB. llvm-svn: 305236
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
index 2c6465e6fb2..12b0c3b36c1 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
@@ -80,6 +80,16 @@ Error PDBFileBuilder::addNamedStream(StringRef Name, uint32_t Size) {
}
Expected<msf::MSFLayout> PDBFileBuilder::finalizeMsfLayout() {
+
+ if (Ipi && Ipi->getRecordCount() > 0) {
+ // In theory newer PDBs always have an ID stream, but by saying that we're
+ // only going to *really* have an ID stream if there is at least one ID
+ // record, we leave open the opportunity to test older PDBs such as those
+ // that don't have an ID stream.
+ auto &Info = getInfoBuilder();
+ Info.addFeature(PdbRaw_FeatureSig::VC140);
+ }
+
uint32_t StringsLen = Strings.calculateSerializedSize();
if (auto EC = addNamedStream("/names", StringsLen))
OpenPOWER on IntegriCloud