aboutsummaryrefslogtreecommitdiff
path: root/lld
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2020-09-15 18:50:34 -0700
committerReid Kleckner <rnk@google.com>2020-09-15 18:50:37 -0700
commit1b88845ce1b7731a062c3d1fcc80d201c70e4a44 (patch)
tree0b9add9a20f0d323418fe3d92b62771b763fb8a1 /lld
parent5f4abb7fab1c6a87f059ed8732fd12b237f4805d (diff)
downloadllvm-1b88845ce1b7731a062c3d1fcc80d201c70e4a44.zip
llvm-1b88845ce1b7731a062c3d1fcc80d201c70e4a44.tar.gz
llvm-1b88845ce1b7731a062c3d1fcc80d201c70e4a44.tar.bz2
[PDB] Drop LF_PRECOMP from debugTypes earlier
This is a minor simplification to avoid firing up a BinaryStreamReader and CVType parser.
Diffstat (limited to 'lld')
-rw-r--r--lld/COFF/DebugTypes.cpp10
-rw-r--r--lld/COFF/InputFiles.cpp2
2 files changed, 2 insertions, 10 deletions
diff --git a/lld/COFF/DebugTypes.cpp b/lld/COFF/DebugTypes.cpp
index b8c488f..3a9bd83 100644
--- a/lld/COFF/DebugTypes.cpp
+++ b/lld/COFF/DebugTypes.cpp
@@ -447,16 +447,6 @@ UsePrecompSource::mergeDebugT(TypeMerger *m, CVIndexMap *indexMap) {
if (!e)
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);
}
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index a692dfe..6522d68 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -821,6 +821,8 @@ void ObjFile::initializeDependencies() {
PrecompRecord precomp = cantFail(
TypeDeserializer::deserializeAs<PrecompRecord>(firstType->data()));
debugTypesObj = makeUsePrecompSource(this, precomp);
+ // Drop the LF_PRECOMP record from the input stream.
+ debugTypes = debugTypes.drop_front(firstType->RecordData.size());
return;
}