diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-11-17 14:56:44 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2021-11-17 15:00:32 +0000 |
commit | cef4170c07d11ee3c1156a1e7b61d7d52e2c00ae (patch) | |
tree | 2b86d9f70eb07f205b9516fdde2b5b7d82a18079 /compiler/GHC/Driver/Backpack.hs | |
parent | 3e94b5a7ebddf156f00599c6bd2e9ba1af437a6c (diff) | |
download | haskell-wip/remove-complexity-bkp.tar.gz |
Remove unused module import syntax from .bkp modewip/remove-complexity-bkp
.bkp mode had this unused feature where you could write
module A
and it would go looking for A.hs on the file system and use that rather
than provide the definition inline.
This isn't use anywhere in the testsuite and the code to find the module
A looks dubious. Therefore to reduce .bkp complexity I propose to remove
it.
Fixes #20701
Diffstat (limited to 'compiler/GHC/Driver/Backpack.hs')
-rw-r--r-- | compiler/GHC/Driver/Backpack.hs | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/compiler/GHC/Driver/Backpack.hs b/compiler/GHC/Driver/Backpack.hs index 852ff4c0f2..1da05dbda8 100644 --- a/compiler/GHC/Driver/Backpack.hs +++ b/compiler/GHC/Driver/Backpack.hs @@ -719,8 +719,8 @@ hsunitModuleGraph unit = do -- 1. Create a HsSrcFile/HsigFile summary for every -- explicitly mentioned module/signature. - let get_decl (L _ (DeclD hsc_src lmodname mb_hsmod)) = - Just `fmap` summariseDecl pn hsc_src lmodname mb_hsmod + let get_decl (L _ (DeclD hsc_src lmodname hsmod)) = + Just `fmap` summariseDecl pn hsc_src lmodname hsmod get_decl _ = return Nothing nodes <- catMaybes `fmap` mapM get_decl decls @@ -806,23 +806,9 @@ summariseRequirement pn mod_name = do summariseDecl :: PackageName -> HscSource -> Located ModuleName - -> Maybe (Located HsModule) + -> Located HsModule -> BkpM ExtendedModSummary -summariseDecl pn hsc_src (L _ modname) (Just hsmod) = hsModuleToModSummary pn hsc_src modname hsmod -summariseDecl _pn hsc_src lmodname@(L loc modname) Nothing - = do hsc_env <- getSession - -- TODO: this looks for modules in the wrong place - r <- liftIO $ summariseModule hsc_env - emptyModNodeMap -- GHC API recomp not supported - (hscSourceToIsBoot hsc_src) - lmodname - Nothing -- GHC API buffer support not supported - [] -- No exclusions - case r of - Nothing -> throwOneError $ fmap GhcDriverMessage - $ mkPlainErrorMsgEnvelope loc (DriverBackpackModuleNotFound modname) - Just (Left err) -> throwErrors (fmap GhcDriverMessage err) - Just (Right summary) -> return summary +summariseDecl pn hsc_src (L _ modname) hsmod = hsModuleToModSummary pn hsc_src modname hsmod -- | Up until now, GHC has assumed a single compilation target per source file. -- Backpack files with inline modules break this model, since a single file |