2 % (c) The AQUA Project, Glasgow University, 1993-2000
4 \section[CompManager]{The Compilation Manager}
7 module CompManager ( cmInit, cmLoadModule,
13 #include "HsVersions.h"
15 import Outputable ( SDoc )
16 import FiniteMap ( emptyFM )
18 import CmStaticInfo ( FLAGS, PCI, SI, mkSI )
19 import CmFind ( Finder, newFinder, ModName )
20 import CmSummarise ( )
21 import CmCompile ( PCS, emptyPCS, HST, HIT )
22 import CmLink ( PLS, emptyPLS, HValue, Linkable )
30 = emptyCmState flags pkginfo
32 cmLoadModule :: CmState
34 -> IO (CmState, Either [SDoc] ModHandle)
35 cmLoadModule cmstate modname
36 = return (error "cmLoadModule:unimp")
41 -> IO (CmState, Either [SDoc] HValue)
42 cmGetExpr cmstate modhdl expr
43 = return (error "cmGetExpr:unimp")
45 cmRunExpr :: HValue -> IO ()
47 = return (error "cmRunExpr:unimp")
49 type ModHandle = String -- ToDo: do better?
52 -- Persistent state just for CM, excluding link & compile subsystems
54 = PCMS HST -- home symbol table
55 HIT -- home interface table
56 UI -- the unlinked images
57 MG -- the module graph
60 emptyPCMS = PCMS emptyHST emptyHIT emptyUI emptyMG
70 -- Persistent state for the entire system
72 = CmState PCMS -- CM's persistent state
73 PCS -- compile's persistent state
74 PLS -- link's persistent state
75 SI -- static info, never changes
76 Finder -- the module finder
78 emptyCmState :: FLAGS -> PCI -> IO CmState
79 emptyCmState flags pci
80 = do let pcms = emptyPCMS
83 let si = mkSI flags pci
84 finder <- newFinder pci
85 return (CmState pcms pcs pls si finder)
88 type UI = [Linkable] -- the unlinked images (should be a set, really)
93 data MG = MG -- the module graph