Wolfgang Jeltsch pushed to branch wip/jeltsch/module-graph-reuse-in-downsweep at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Driver/Downsweep.hs
    ... ... @@ -162,6 +162,13 @@ moduleGraphNodeMap graph
    162 162
     -- cache to avoid recalculating a module summary if the source is
    
    163 163
     -- unchanged.
    
    164 164
     --
    
    165
    +-- Downsweeping can start from scratch for from a given module graph. In the
    
    166
    +-- latter case, the given graph is fully included in the resulting graph, even
    
    167
    +-- if parts of it are not reachable from any of the given roots. When an import
    
    168
    +-- is processed, the source of the imported module is not consulted if this
    
    169
    +-- module is already mentioned in the given graph. The sources of the root
    
    170
    +-- modules are always consulted, though.
    
    171
    +--
    
    165 172
     -- The returned ModuleGraph has one node for each home-package
    
    166 173
     -- module, plus one for any hs-boot files.  The imports of these nodes
    
    167 174
     -- are all there, including the imports of non-home-package modules.
    
    ... ... @@ -177,7 +184,7 @@ downsweep :: HscEnv
    177 184
               -> [ModSummary]
    
    178 185
               -- ^ Old summaries
    
    179 186
               -> Maybe ModuleGraph
    
    180
    -          -- ^ Existing module graph from which to reuse nodes
    
    187
    +          -- ^ Optionally a module graph to extend
    
    181 188
               -> [ModuleName]       -- Ignore dependencies on these; treat
    
    182 189
                                     -- them as if they were package modules
    
    183 190
               -> Bool               -- True <=> allow multiple targets to have