Skip to content

Linker: some refactoring to prepare for #24886

Sylvain Henry requested to merge hsyl20/ghc:hsyl20/linker-refactor2 into master
  • Rename LoadedBCOs into LazyBCOs
  • Bundle SptEntries with CompiledByteCode and removed [SptEntry] field from the BCOs constructor
  • Rename Linkable's LM constructor into Linkable: in the past we had LM and LP for Module and Package, now we only have the former.
  • Rename Unlinked into LinkablePart (and linkableUnlinked into linkableParts)
  • Use NonEmpty to encode invariant in Linkable's linkableParts type
  • Add helpers: linkableLibs, linkableBCOs, etc.
  • Add documentation
  • Remove partial nameOfObject
  • Rename nameOfObject_maybe into linkablePartPath
  • Rename byteCodeOfObject into linkablePartAllBCOs.
  • Refactor linkablePartAllBCOs to avoid a panic if a LazyBCO has a C stub. Document the fact that LazyBCOs are returned in this case (contrary to linkableBCOs which only returns non-lazy ones)

Refactoring done while trying to understand how to adapt the linker code to support the JS backend too (cf #24886).

Merge request reports

Loading