[all-commits] [llvm/llvm-project] 3a5fb5: [ELF] Replace LazyObjFile with lazy ObjFile/Bitcod...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Dec 22 17:42:02 PST 2021

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3a5fb57393c3bc77be9e7afc2ec9d4ec3c9bbf70
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-12-22 (Wed, 22 Dec 2021)

  Changed paths:
    M lld/ELF/Driver.cpp
    M lld/ELF/InputFiles.cpp
    M lld/ELF/InputFiles.h
    M lld/ELF/LTO.cpp
    M lld/ELF/Symbols.cpp
    M lld/ELF/Symbols.h
    M lld/test/ELF/lazy-arch-conflict.s

  Log Message:
  [ELF] Replace LazyObjFile with lazy ObjFile/BitcodeFile

The new `lazy` state is the inverse of the previous `LazyObjFile::extracted`.
There are many advantages:

* 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
* the `incompatible file:` diagnostic is unified with `is incompatible with`
* simpler code, smaller executable (6200+ bytes smaller on x86-64)
* make eager parsing feasible (for parallel section/symbol table initialization)

More information about the All-commits mailing list