[PATCH] D45213: [COFF][LLD] Add link support for precompiled headers .objs

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 11 15:03:22 PDT 2018


aganea added a comment.

Following https://reviews.llvm.org/D45283, I've updated the review only with the type merging and LLD support.
Some extra support would be needed for `llvm-readobj -codeview-merged-types`, but I prefer to do that later.



================
Comment at: lld/COFF/PDB.cpp:303
+                      maybeReadRecord<PrecompRecord>(Types, LF_PRECOMP, true)) {
+    const CVIndexMap &PrecompIndexMap = aquirePrecompObj(File, *Precomp);
+    assert(PrecompIndexMap.IsPrecompiledTypeMap);
----------------
I choose to preempt loading of the current .obj, and load the precomp .obj here. However if (future) multithreading is a concern, I could instead push the processing of the current .obj at the end of the stack. Let me know whichever you prefer.


================
Comment at: lld/COFF/PDB.cpp:312
+    // Use the precomp's previously remapped index map
+    ObjectIndexMap.TPIMap.append(PrecompIndexMap.TPIMap.begin(),
+               PrecompIndexMap.TPIMap.begin() + Precomp->getTypesCount());
----------------
The magic happens here.


Repository:
  rL LLVM

https://reviews.llvm.org/D45213





More information about the llvm-commits mailing list