Delete pci field from PersistentCMState. Now that the list of available
packages is a global variable (v_Packages), there's no point in having it
in PersistentCMState.
import Module ( ModuleName, moduleName,
isHomeModule, moduleEnvElts,
moduleNameUserString )
import Module ( ModuleName, moduleName,
isHomeModule, moduleEnvElts,
moduleNameUserString )
-import CmStaticInfo ( PackageConfigInfo, GhciMode(..) )
+import CmStaticInfo ( GhciMode(..) )
import DriverPipeline
import GetImports
import HscTypes ( HomeSymbolTable, HomeIfaceTable,
import DriverPipeline
import GetImports
import HscTypes ( HomeSymbolTable, HomeIfaceTable,
-cmInit :: PackageConfigInfo -> GhciMode -> IO CmState
-cmInit raw_package_info gmode
- = emptyCmState raw_package_info gmode
+cmInit :: GhciMode -> IO CmState
+cmInit gmode
+ = emptyCmState gmode
#ifdef GHCI
cmGetExpr :: CmState
#ifdef GHCI
cmGetExpr :: CmState
hit :: HomeIfaceTable, -- home interface table
ui :: UnlinkedImage, -- the unlinked images
mg :: ModuleGraph, -- the module graph
hit :: HomeIfaceTable, -- home interface table
ui :: UnlinkedImage, -- the unlinked images
mg :: ModuleGraph, -- the module graph
- pci :: PackageConfigInfo, -- NEVER CHANGES
gmode :: GhciMode -- NEVER CHANGES
}
gmode :: GhciMode -- NEVER CHANGES
}
-emptyPCMS :: PackageConfigInfo -> GhciMode -> PersistentCMState
-emptyPCMS pci gmode
+emptyPCMS :: GhciMode -> PersistentCMState
+emptyPCMS gmode
= PersistentCMState { hst = emptyHST, hit = emptyHIT,
ui = emptyUI, mg = emptyMG,
= PersistentCMState { hst = emptyHST, hit = emptyHIT,
ui = emptyUI, mg = emptyMG,
- pci = pci, gmode = gmode }
emptyHIT :: HomeIfaceTable
emptyHIT = emptyUFM
emptyHIT :: HomeIfaceTable
emptyHIT = emptyUFM
pls :: PersistentLinkerState -- link's persistent state
}
pls :: PersistentLinkerState -- link's persistent state
}
-emptyCmState :: PackageConfigInfo -> GhciMode -> IO CmState
-emptyCmState pci gmode
- = do let pcms = emptyPCMS pci gmode
+emptyCmState :: GhciMode -> IO CmState
+emptyCmState gmode
+ = do let pcms = emptyPCMS gmode
pcs <- initPersistentCompilerState
pls <- emptyPLS
return (CmState { pcms = pcms,
pcs <- initPersistentCompilerState
pls <- emptyPLS
return (CmState { pcms = pcms,
let hit1 = hit pcms1
let ui1 = ui pcms1
let hit1 = hit pcms1
let ui1 = ui pcms1
- let pcii = pci pcms1 -- this never changes
- let ghci_mode = gmode pcms1 -- ToDo: fix!
+ let ghci_mode = gmode pcms1 -- this never changes
-- Do the downsweep to reestablish the module graph
-- then generate version 2's by removing from HIT,HST,UI any
-- Do the downsweep to reestablish the module graph
-- then generate version 2's by removing from HIT,HST,UI any
let verb = verbosity dflags
showPass dflags "Chasing dependencies"
let verb = verbosity dflags
showPass dflags "Chasing dependencies"
+ when (verb >= 1 && ghci_mode == Batch) $
+ hPutStrLn stderr ("ghc: chasing modules from: " ++ rootname)
mg2unsorted <- downsweep [rootname]
mg2unsorted <- downsweep [rootname]
LinkOK pls3
-> do let pcms3 = PersistentCMState { hst=hst3, hit=hit3,
ui=ui3, mg=modsDone,
LinkOK pls3
-> do let pcms3 = PersistentCMState { hst=hst3, hit=hit3,
ui=ui3, mg=modsDone,
- pci=pcii, gmode=ghci_mode }
let cmstate3
= CmState { pcms=pcms3, pcs=pcs3, pls=pls3 }
return (cmstate3, True, map name_of_summary modsDone)
let cmstate3
= CmState { pcms=pcms3, pcs=pcs3, pls=pls3 }
return (cmstate3, True, map name_of_summary modsDone)
LinkOK pls4
-> do let pcms4 = PersistentCMState { hst=hst4, hit=hit4,
ui=ui4, mg=mods_to_keep,
LinkOK pls4
-> do let pcms4 = PersistentCMState { hst=hst4, hit=hit4,
ui=ui4, mg=mods_to_keep,
- pci=pcii, gmode=ghci_mode }
let cmstate4
= CmState { pcms=pcms4, pcs=pcs3, pls=pls4 }
return (cmstate4, False, mods_to_keep_names)
let cmstate4
= CmState { pcms=pcms4, pcs=pcs3, pls=pls4 }
return (cmstate4, False, mods_to_keep_names)
{-# OPTIONS -W -fno-warn-incomplete-patterns #-}
-----------------------------------------------------------------------------
{-# OPTIONS -W -fno-warn-incomplete-patterns #-}
-----------------------------------------------------------------------------
--- $Id: Main.hs,v 1.30 2000/11/21 16:18:17 sewardj Exp $
+-- $Id: Main.hs,v 1.31 2000/11/21 16:31:51 sewardj Exp $
--
-- GHC Driver program
--
--
-- GHC Driver program
--
when (mode == DoMkDependHS) beginMkDependHS
-- make/interactive require invoking the compilation manager
when (mode == DoMkDependHS) beginMkDependHS
-- make/interactive require invoking the compilation manager
- if (mode == DoMake) then beginMake pkg_avails srcs else do
- if (mode == DoInteractive) then beginInteractive pkg_avails srcs else do
+ if (mode == DoMake) then beginMake srcs else do
+ if (mode == DoInteractive) then beginInteractive srcs else do
-- for each source file, find which phases to run
let lang = hscLang init_dyn_flags
-- for each source file, find which phases to run
let lang = hscLang init_dyn_flags
some -> writeIORef v_TopDir (drop 2 (last some)))
return others
some -> writeIORef v_TopDir (drop 2 (last some)))
return others
-beginMake :: PackageConfigInfo -> [String] -> IO ()
-beginMake pkg_details mods
+beginMake :: [String] -> IO ()
+beginMake mods
= do case mods of
[] -> throwDyn (UsageError "no input files")
= do case mods of
[] -> throwDyn (UsageError "no input files")
- [mod] -> do state <- cmInit pkg_details Batch
+ [mod] -> do state <- cmInit Batch
cmLoadModule state mod
return ()
_ -> throwDyn (UsageError "only one module allowed with --make")
cmLoadModule state mod
return ()
_ -> throwDyn (UsageError "only one module allowed with --make")
+
+beginInteractive :: [String] -> IO ()
#ifndef GHCI
beginInteractive = throwDyn (OtherError "not build for interactive use")
#else
#ifndef GHCI
beginInteractive = throwDyn (OtherError "not build for interactive use")
#else
-beginInteractive pkg_details mods
- = do state <- cmInit pkg_details Interactive
+beginInteractive mods
+ = do state <- cmInit Interactive
case mods of
[] -> return ()
[mod] -> do cmLoadModule state mod; return ()
case mods of
[] -> return ()
[mod] -> do cmLoadModule state mod; return ()