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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305236
91177308-0d34-0410-b5e6-
96231b3b80d8
Error finalizeMsfLayout();
+ uint32_t getRecordCount() const { return TypeRecords.size(); }
+
Error commit(const msf::MSFLayout &Layout, WritableBinaryStreamRef Buffer);
uint32_t calculateSerializedLength();
}
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))
IpiBuilder.addTypeRecord(Type.RecordData, None);
}
- if (!Ipi.Records.empty()) {
- // 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.
- InfoBuilder.addFeature(PdbRaw_FeatureSig::VC140);
- }
-
ExitOnErr(Builder.commit(opts::yaml2pdb::YamlPdbOutputFile));
}