[lld-link] Replace LazyObjFile with lazy ObjFile/BitcodeFile
authorFangrui Song <i@maskray.me>
Tue, 4 Jan 2022 23:11:44 +0000 (15:11 -0800)
committerFangrui Song <i@maskray.me>
Tue, 4 Jan 2022 23:11:44 +0000 (15:11 -0800)
commitd496abbe2a03721d5d22a697a3a1c5961a55f7f2
tree5d7f3cfb314d10e714572aa5b19aeff0a03f6cd6
parent1e1e97a3267325487ffae4a16fdaaec58931ca86
[lld-link] Replace LazyObjFile with lazy ObjFile/BitcodeFile

Similar to ELF 3a5fb57393c3bc77be9e7afc2ec9d4ec3c9bbf70.

* previously when a LazyObjFile was extracted, a new ObjFile/BitcodeFile was created; now the file is reused, just with `lazy` cleared
* avoid the confusing transfer of `symbols` from LazyObjFile to the new file
* simpler code, smaller executable (5200+ bytes smaller on x86-64)
* make eager parsing feasible (for parallel section/symbol table initialization)

Reviewed By: aganea, rnk

Differential Revision: https://reviews.llvm.org/D116434
lld/COFF/Driver.cpp
lld/COFF/InputFiles.cpp
lld/COFF/InputFiles.h
lld/COFF/SymbolTable.cpp
lld/COFF/SymbolTable.h
lld/COFF/Symbols.h