Rodrigo Mesquita pushed to branch wip/spj-reinstallable-base2 at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Iface/Load.hs
    ... ... @@ -370,16 +370,20 @@ checkKnownKeyNamesIface known_key_names_occ_map
    370 370
     -- | Lookup the module exporting the canonical known-entities definitions (GHC.Essentials)
    
    371 371
     lookupKnownKeysModule :: HscEnv -> DynFlags {-^ Module dyn flags -} -> IO (Maybe Module)
    
    372 372
     lookupKnownKeysModule hsc_env dflags = do
    
    373
    -  found_essentials <- findImportedModule hsc_env eSSENTIALS_NAME NoPkgQual
    
    374
    -  let rebindable_kn = gopt Opt_RebindableKnownNames dflags
    
    375
    -  let essentials_uid
    
    376
    -        | rebindable_kn                   = return Nothing
    
    377
    -        | Found _ mod <- found_essentials = return (Just mod)
    
    378
    -        | fr          <- found_essentials = do
    
    379
    -            throwOneError (initSourceErrorContext dflags) $
    
    380
    -              mkPlainErrorMsgEnvelope noSrcSpan $ GhcDriverMessage $ DriverInterfaceError $
    
    381
    -                CantFindEssentials (cannotFindModule hsc_env eSSENTIALS_NAME fr) LookingForEssentialsModule
    
    382
    -  essentials_uid
    
    373
    +  eps <- hscEPS hsc_env
    
    374
    +  case eps_known_keys eps of
    
    375
    +    Just (_, kk_mod) -> return (Just kk_mod)
    
    376
    +    Nothing -> do
    
    377
    +      found_essentials <- findImportedModule hsc_env eSSENTIALS_NAME NoPkgQual
    
    378
    +      let rebindable_kn = gopt Opt_RebindableKnownNames dflags
    
    379
    +      let essentials_uid
    
    380
    +            | rebindable_kn                   = return Nothing
    
    381
    +            | Found _ mod <- found_essentials = return (Just mod)
    
    382
    +            | fr          <- found_essentials = do
    
    383
    +                throwOneError (initSourceErrorContext dflags) $
    
    384
    +                  mkPlainErrorMsgEnvelope noSrcSpan $ GhcDriverMessage $ DriverInterfaceError $
    
    385
    +                    CantFindEssentials (cannotFindModule hsc_env eSSENTIALS_NAME fr) LookingForEssentialsModule
    
    386
    +      essentials_uid
    
    383 387
     
    
    384 388
     {- *********************************************************************
    
    385 389
     *                                                                      *