[PDB] Drop LF_PRECOMP from debugTypes earlier
This is a minor simplification to avoid firing up a BinaryStreamReader and CVType parser.
This commit is contained in:
parent
5f4abb7fab
commit
1b88845ce1
|
|
@ -447,16 +447,6 @@ UsePrecompSource::mergeDebugT(TypeMerger *m, CVIndexMap *indexMap) {
|
||||||
if (!e)
|
if (!e)
|
||||||
return e.takeError();
|
return e.takeError();
|
||||||
|
|
||||||
// Drop LF_PRECOMP record from the input stream, as it has been replaced
|
|
||||||
// with the precompiled headers Type stream in the mergeInPrecompHeaderObj()
|
|
||||||
// call above. Note that we can't just call Types.drop_front(), as we
|
|
||||||
// explicitly want to rebase the stream.
|
|
||||||
CVTypeArray types;
|
|
||||||
BinaryStreamReader reader(file->debugTypes, support::little);
|
|
||||||
cantFail(reader.readArray(types, reader.getLength()));
|
|
||||||
auto firstType = types.begin();
|
|
||||||
file->debugTypes = file->debugTypes.drop_front(firstType->RecordData.size());
|
|
||||||
|
|
||||||
return TpiSource::mergeDebugT(m, indexMap);
|
return TpiSource::mergeDebugT(m, indexMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -821,6 +821,8 @@ void ObjFile::initializeDependencies() {
|
||||||
PrecompRecord precomp = cantFail(
|
PrecompRecord precomp = cantFail(
|
||||||
TypeDeserializer::deserializeAs<PrecompRecord>(firstType->data()));
|
TypeDeserializer::deserializeAs<PrecompRecord>(firstType->data()));
|
||||||
debugTypesObj = makeUsePrecompSource(this, precomp);
|
debugTypesObj = makeUsePrecompSource(this, precomp);
|
||||||
|
// Drop the LF_PRECOMP record from the input stream.
|
||||||
|
debugTypes = debugTypes.drop_front(firstType->RecordData.size());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue