GHC.Unit.Module.ModSummary

ghc-9.2.0.20210821: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Unit.Module.ModSummary

Description

A ModSummary is a node in the compilation manager's dependency graph (ModuleGraph)

Synopsis

- data ExtendedModSummary = ExtendedModSummary {
  - emsModSummary :: !ModSummary
  - emsInstantiatedUnits :: [InstantiatedUnit]
  }
- extendModSummaryNoDeps :: ModSummary -> ExtendedModSummary
- data ModSummary = ModSummary {
  - ms_mod :: Module
  - ms_hsc_src :: HscSource
  - ms_location :: ModLocation
  - ms_hs_date :: UTCTime
  - ms_obj_date :: Maybe UTCTime
  - ms_iface_date :: Maybe UTCTime
  - ms_hie_date :: Maybe UTCTime
  - ms_srcimps :: [(Maybe FastString, Located ModuleName)]
  - ms_textual_imps :: [(Maybe FastString, Located ModuleName)]
  - ms_parsed_mod :: Maybe HsParsedModule
  - ms_hspp_file :: FilePath
  - ms_hspp_opts :: DynFlags
  - ms_hspp_buf :: Maybe StringBuffer
  }
- ms_installed_mod :: ModSummary -> InstalledModule
- ms_mod_name :: ModSummary -> ModuleName
- ms_imps :: ModSummary -> [(Maybe FastString, Located ModuleName)]
- ms_home_allimps :: ModSummary -> [ModuleName]
- ms_home_srcimps :: ModSummary -> [Located ModuleName]
- ms_home_imps :: ModSummary -> [Located ModuleName]
- msHiFilePath :: ModSummary -> FilePath
- msHsFilePath :: ModSummary -> FilePath
- msObjFilePath :: ModSummary -> FilePath
- msDynObjFilePath :: ModSummary -> DynFlags -> FilePath
- isBootSummary :: ModSummary -> IsBootInterface
- findTarget :: ModSummary -> [Target] -> Maybe Target

# Documentation

data ExtendedModSummary Source #

Enrichment of `ModSummary` with backpack dependencies

Constructors

ExtendedModSummary |
Fields emsModSummary :: !ModSummary emsInstantiatedUnits :: [InstantiatedUnit] Extra backpack deps NB: This is sometimes left empty in situations where the instantiated units would not be used. See call sites of `extendModSummaryNoDeps`.

#### Instances

Instances details

Outputable ExtendedModSummary Source # |
Instance details Defined in GHC.Unit.Module.ModSummary Methods ppr :: ExtendedModSummary -> SDoc Source #

extendModSummaryNoDeps :: ModSummary -> ExtendedModSummary Source #

data ModSummary Source #

Data for a module node in a `ModuleGraph`. Module nodes of the module graph are one of:

- A regular Haskell source module
- A hi-boot source module

Constructors

ModSummary |
Fields ms_mod :: Module Identity of the module ms_hsc_src :: HscSource The module source either plain Haskell, hs-boot, or hsig ms_location :: ModLocation Location of the various files belonging to the module ms_hs_date :: UTCTime Timestamp of source file ms_obj_date :: Maybe UTCTime Timestamp of object, if we have one ms_iface_date :: Maybe UTCTime Timestamp of hi file, if we *only* are typechecking (it is `Nothing` otherwise. See Note [Recompilation checking in -fno-code mode] and #9243 ms_hie_date :: Maybe UTCTime Timestamp of hie file, if we have one ms_srcimps :: [(Maybe FastString, Located ModuleName)] Source imports of the module ms_textual_imps :: [(Maybe FastString, Located ModuleName)] Non-source imports of the module from the module *text* ms_parsed_mod :: Maybe HsParsedModule The parsed, nonrenamed source, if we have it. This is also used to support "inline module syntax" in Backpack files. ms_hspp_file :: FilePath Filename of preprocessed source file ms_hspp_opts :: DynFlags Cached flags from `OPTIONS`, `INCLUDE` and `LANGUAGE` pragmas in the modules source code ms_hspp_buf :: Maybe StringBuffer The actual preprocessed source, if we have it

#### Instances

Instances details

Outputable ModSummary Source # |
Instance details Defined in GHC.Unit.Module.ModSummary Methods ppr :: ModSummary -> SDoc Source #

ms_installed_mod :: ModSummary -> InstalledModule Source #

ms_mod_name :: ModSummary -> ModuleName Source #

ms_imps :: ModSummary -> [(Maybe FastString, Located ModuleName)] Source #

ms_home_allimps :: ModSummary -> [ModuleName] Source #

ms_home_srcimps :: ModSummary -> [Located ModuleName] Source #

Like `ms_home_imps`, but for SOURCE imports.

ms_home_imps :: ModSummary -> [Located ModuleName] Source #

All of the (possibly) home module imports from a `ModSummary`; that is to say, each of these module names could be a home import if an appropriately named file existed. (This is in contrast to package qualified imports, which are guaranteed not to be home imports.)

msHiFilePath :: ModSummary -> FilePath Source #

msHsFilePath :: ModSummary -> FilePath Source #

msObjFilePath :: ModSummary -> FilePath Source #

msDynObjFilePath :: ModSummary -> DynFlags -> FilePath Source #

isBootSummary :: ModSummary -> IsBootInterface Source #

Did this `ModSummary` originate from a hs-boot file?

findTarget :: ModSummary -> [Target] -> Maybe Target Source #