[all-commits] [llvm/llvm-project] 74b888: [lld-macho][NFC] Minor refactor of Writer::run()

Greg McGary via All-commits all-commits at lists.llvm.org
Wed Mar 17 15:16:29 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 74b888baaddc7ca0fe692650db1f2214be66f28a
      https://github.com/llvm/llvm-project/commit/74b888baaddc7ca0fe692650db1f2214be66f28a
  Author: Greg McGary <gkm at fb.com>
  Date:   2021-03-17 (Wed, 17 Mar 2021)

  Changed paths:
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/SyntheticSections.h
    M lld/MachO/Target.h
    M lld/MachO/Writer.cpp
    M lld/MachO/Writer.h

  Log Message:
  -----------
  [lld-macho][NFC] Minor refactor of Writer::run()

Move some functions closer to their uses. Move detailed address-assignment logic out of the otherwise abstract `Writer::run()`. This prepares the ground for a diff to implement branch range extension thunks.

* `SyntheticSections.cpp`
 ** move `needsBinding()` and `prepareBranchTarget()` into `Writer.cpp`
 ** move `addNonLazyBindingEntries()` adjacent to its use.

* `Writer.cpp`
 ** move address-assignment logic from `Writer::run()` into new function `Writer::assignAddresses()`
 ** move `needsBinding()` and `prepareBranchTarget()` from `SyntheticSections.cpp`

* `Target.h`
** remove orphaned decls of `prepareSymbolRelocation()` and `validateRelocationInfo()` which were moved to other files in earlier diffs.

Differential Revision: https://reviews.llvm.org/D98795




More information about the All-commits mailing list