Hannes Siebenhandl pushed to branch wip/jeltsch/improve-closure-property-check.global-unit-info-map at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Driver/Session/Units.hs
    ... ... @@ -145,8 +145,15 @@ initMulti unitArgsFiles lintDynFlagsAndSrcs = do
    145 145
       checkUnitCycles initial_dflags home_unit_graph
    
    146 146
     
    
    147 147
       let dflags = homeUnitEnv_dflags $ HUG.unitEnv_lookup mainUnitId home_unit_graph
    
    148
    -  unitEnv <- assertUnitEnvInvariant <$> (liftIO $ initUnitEnv mainUnitId home_unit_graph (ghcNameVersion dflags) (targetPlatform dflags))
    
    149
    -  let final_hsc_env = hsc_env { hsc_unit_env = unitEnv }
    
    148
    +  newUnitEnv <-  do
    
    149
    +    env <- liftIO $ initUnitEnv mainUnitId home_unit_graph (ghcNameVersion dflags) (targetPlatform dflags)
    
    150
    +    -- We need to reuse the 'UnitIndexCache' as we used it above in 'initUnits'.
    
    151
    +    -- See Note [Sharing 'UnitInfo's across the 'UnitEnv'] why this must be shared.
    
    152
    +    pure $ assertUnitEnvInvariant $ env
    
    153
    +      { ue_uic = hscUIC hsc_env
    
    154
    +      }
    
    155
    +
    
    156
    +  let final_hsc_env = hsc_env { hsc_unit_env = newUnitEnv }
    
    150 157
     
    
    151 158
       GHC.setSession final_hsc_env
    
    152 159