aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Interface.hs
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2010-08-26 21:40:59 +0000
committerDavid Waern <david.waern@gmail.com>2010-08-26 21:40:59 +0000
commitd830dca2ed25bb71b7c745feef715dab7de2c007 (patch)
tree61a78f63519653ab25b94872f4c65612403d4d52 /src/Haddock/Interface.hs
parent5a5c656c9817e1f0d83531cec4eeca38333519df (diff)
Get rid of GhcModule and related cruft
We can get everything we need directly from TypecheckedModule.
Diffstat (limited to 'src/Haddock/Interface.hs')
-rw-r--r--src/Haddock/Interface.hs45
1 files changed, 2 insertions, 43 deletions
diff --git a/src/Haddock/Interface.hs b/src/Haddock/Interface.hs
index fbc2a7d3..0c171cbc 100644
--- a/src/Haddock/Interface.hs
+++ b/src/Haddock/Interface.hs
@@ -43,7 +43,6 @@ import Haddock.Utils
import Control.Monad
import Data.List
import qualified Data.Map as Map
-import Data.Maybe
import Distribution.Verbosity
import System.Directory
import System.FilePath
@@ -156,21 +155,11 @@ createIfaces verbosity flags instIfaceMap mods = do
processModule :: Verbosity -> ModSummary -> [Flag] -> IfaceMap -> InstIfaceMap -> Ghc (Maybe Interface)
processModule verbosity modsum flags modMap instIfaceMap = do
out verbosity verbose $ "Checking module " ++ moduleString (ms_mod modsum) ++ "..."
- tc_mod <- loadModule =<< typecheckModule =<< parseModule modsum
+ tm <- loadModule =<< typecheckModule =<< parseModule modsum
if not $ isBootSummary modsum
then do
- let filename = msHsFilePath modsum
- let dynflags = ms_hspp_opts modsum
- let Just renamed_src = renamedSource tc_mod
- let ghcMod = mkGhcModule (ms_mod modsum,
- filename,
- (parsedSource tc_mod,
- renamed_src,
- typecheckedSource tc_mod,
- moduleInfo tc_mod))
- dynflags
out verbosity verbose "Creating interface..."
- (interface, msg) <- runWriterGhc $ createInterface ghcMod flags modMap instIfaceMap
+ (interface, msg) <- runWriterGhc $ createInterface tm flags modMap instIfaceMap
liftIO $ mapM_ putStrLn msg
interface' <- liftIO $ evaluate interface
return (Just interface')
@@ -178,36 +167,6 @@ processModule verbosity modsum flags modMap instIfaceMap = do
return Nothing
-type CheckedMod = (Module, FilePath, FullyCheckedMod)
-
-
-type FullyCheckedMod = (ParsedSource,
- RenamedSource,
- TypecheckedSource,
- ModuleInfo)
-
-
--- | Dig out what we want from the typechecker output
-mkGhcModule :: CheckedMod -> DynFlags -> GhcModule
-mkGhcModule (mdl, file, checkedMod) dynflags = GhcModule {
- ghcModule = mdl,
- ghcFilename = file,
- ghcMbDocOpts = mbOpts,
- ghcMbDocHdr = mbDocHdr,
- ghcGroup = group_,
- ghcMbExports = mbExports,
- ghcExportedNames = modInfoExports modInfo,
- ghcDefinedNames = map getName $ modInfoTyThings modInfo,
- ghcNamesInScope = fromJust $ modInfoTopLevelScope modInfo,
- ghcInstances = modInfoInstances modInfo,
- ghcDynFlags = dynflags
-}
- where
- mbOpts = haddockOptions dynflags
- (group_, _, mbExports, mbDocHdr) = renamed
- (_, renamed, _, modInfo) = checkedMod
-
-
--------------------------------------------------------------------------------
-- * Building of cross-linking environment
--------------------------------------------------------------------------------