Changes between Version 1 and Version 2 of Commentary/Compiler/ModuleTypes


Ignore:
Timestamp:
Jan 29, 2017 6:39:20 AM (3 years ago)
Author:
takenobu
Comment:

fix file names (.lhs to .hs)

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/ModuleTypes

    v1 v2  
    33= Module Types =
    44
    5 Here we attempt to describe some of the main data structures involved in GHC's representation and handling of Haksell modules. GHC uses a number of different data types to represent modules, for efficiency (some types load less information) and categorising how other modules relate to the one being compiled. Most these types are defined in [[GhcFile(compiler/main/HscTypes.lhs)]].
     5Here we attempt to describe some of the main data structures involved in GHC's representation and handling of Haksell modules. GHC uses a number of different data types to represent modules, for efficiency (some types load less information) and categorising how other modules relate to the one being compiled. Most these types are defined in [[GhcFile(compiler/main/HscTypes.hs)]].
    66
    77== Module ==
    88
    9 Location: [[GhcFile(compiler/basicTypes/Module.lhs)]]
     9Location: [[GhcFile(compiler/basicTypes/Module.hs)]]
    1010
    1111The '''Module''' data type is simply an identifier of a module; its fully qualified name.
     
    2424== !ModIface ==
    2525
    26 Location: [[GhcFile(compiler/main/HscTypes.lhs)]]
     26Location: [[GhcFile(compiler/main/HscTypes.hs)]]
    2727
    2828The '''!ModIface''' data type is one of the fullest representations of a module. It is a complete representation of a modules interface file ('''.hi'''). It is this data structure that is serialised to produce a modules '''.hi''' file.
     
    3030== !ModDetails ==
    3131
    32 Location: [[GhcFile(compiler/main/HscTypes.lhs)]]
     32Location: [[GhcFile(compiler/main/HscTypes.hs)]]
    3333
    3434'''!ModDetails''' is essentially a cache for information in the '''!ModIface''' for home modules only. It stores information about a module after linking has taken place. '''!ModIface''' stores information about a module before linking. Information stored in a '''!ModDetails''' is created from a '''!ModIface''', typically during type checking.
     
    3636=== !ModGuts ===
    3737
    38 Location: [[GhcFile(compiler/main/HscTypes.lhs)]]
     38Location: [[GhcFile(compiler/main/HscTypes.hs)]]
    3939
    4040A '''!ModGuts''' is carried through the compiler, accumulating stuff as it goes. There is only one '''!ModGuts''' at any time, the one for the module being compiled right now.  Once it is compiled, a '''!ModIface''' and '''!ModDetails''' are extracted and the '''!ModGuts''' is discarded.
     
    4242== !ModSummary ==
    4343
    44 Location: [[GhcFile(compiler/main/HscTypes.lhs)]]
     44Location: [[GhcFile(compiler/main/HscTypes.hs)]]
    4545
    4646A '''!ModSummary''' stores a summary of a module that is suitable for recompilation checking. A '''!ModSummary''' is a node in the compilation manager's dependency graph.
     
    4848== !HomeModInfo ==
    4949
    50 Location: [[GhcFile(compiler/main/HscTypes.lhs)]]
     50Location: [[GhcFile(compiler/main/HscTypes.hs)]]
    5151
    5252A '''!HomeModInfo''' stores information about a module in the package being compiled. It simply stores for the '''!ModIface''', '''!ModDetails''' and linkage information about a single module.
     
    5454== !HomePackageTable ==
    5555
    56 Location: [[GhcFile(compiler/main/HscTypes.lhs)]]
     56Location: [[GhcFile(compiler/main/HscTypes.hs)]]
    5757
    5858The home package table describes already-compiled home-package modules, /excluding/ the module we are compiling right now.
     
    6060== !ExternalPackageState ==
    6161
    62 Location: [[GhcFile(compiler/main/HscTypes.lhs)]]
     62Location: [[GhcFile(compiler/main/HscTypes.hs)]]
    6363
    6464Stores information about other packages that we have pulled in while compiling the current module.