GHC.Runtime.Linker.Types

ghc-9.0.0.20201227: The GHC API

Safe Haskell | None
Language | Haskell2010

GHC.Runtime.Linker.Types

Synopsis

- newtype DynLinker = DynLinker {
  - dl_mpls :: MVar (Maybe PersistentLinkerState)
  }
- data PersistentLinkerState = PersistentLinkerState {
  - closure_env :: ClosureEnv
  - itbl_env :: !ItblEnv
  - bcos_loaded :: ![Linkable]
  - objs_loaded :: ![Linkable]
  - pkgs_loaded :: ![UnitId]
  - temp_sos :: ![(FilePath, String)]
  }
- data Linkable = LM {
  - linkableTime :: UTCTime
  - linkableModule :: Module
  - linkableUnlinked :: [Unlinked]
  }
- data Unlinked
  - = DotO FilePath
  - | DotA FilePath
  - | DotDLL FilePath
  - | BCOs CompiledByteCode [SptEntry]
- data SptEntry = SptEntry Id Fingerprint

# Documentation

newtype DynLinker Source #

Constructors

DynLinker |
Fields dl_mpls :: MVar (Maybe PersistentLinkerState)

data PersistentLinkerState Source #

Constructors

PersistentLinkerState |
Fields closure_env :: ClosureEnv itbl_env :: !ItblEnv bcos_loaded :: ![Linkable] objs_loaded :: ![Linkable] pkgs_loaded :: ![UnitId] temp_sos :: ![(FilePath, String)]

data Linkable Source #

Information we can use to dynamically link modules into the compiler

Constructors

LM |
Fields linkableTime :: UTCTime Time at which this linkable was built (i.e. when the bytecodes were produced, or the mod date on the files) linkableModule :: Module The linkable module itself linkableUnlinked :: [Unlinked] Those files and chunks of code we have yet to link. INVARIANT: A valid linkable always has at least one `Unlinked` item. If this list is empty, the Linkable represents a fake linkable, which is generated in HscNothing mode to avoid recompiling modules. ToDo: Do items get removed from this list when they get linked?

#### Instances

Instances details

Outputable Linkable # |
Instance details Defined in GHC.Runtime.Linker.Types Methods ppr :: Linkable -> SDoc Source # pprPrec :: Rational -> Linkable -> SDoc Source #

data Unlinked Source #

Objects which have yet to be linked by the compiler

Constructors

DotO FilePath | An object file (.o)
DotA FilePath | Static archive file (.a)
DotDLL FilePath | Dynamically linked library file (.so, .dll, .dylib)
BCOs CompiledByteCode [SptEntry] | A byte-code object, lives only in memory. Also carries some static pointer table entries which should be loaded along with the BCOs. See Note [Grant plan for static forms] in GHC.Iface.Tidy.StaticPtrTable.

#### Instances

Instances details

Outputable Unlinked # |
Instance details Defined in GHC.Runtime.Linker.Types Methods ppr :: Unlinked -> SDoc Source # pprPrec :: Rational -> Unlinked -> SDoc Source #

data SptEntry Source #

An entry to be inserted into a module's static pointer table. See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable.

Constructors

SptEntry Id Fingerprint |

#### Instances

Instances details

Outputable SptEntry # |
Instance details Defined in GHC.Runtime.Linker.Types Methods ppr :: SptEntry -> SDoc Source # pprPrec :: Rational -> SptEntry -> SDoc Source #