-----------------------------------------------------------------------------
--- $Id: DriverPipeline.hs,v 1.8 2000/10/26 16:21:02 sewardj Exp $
+-- $Id: DriverPipeline.hs,v 1.9 2000/10/27 11:48:55 sewardj Exp $
--
-- GHC Driver
--
import DriverPhases
import DriverFlags
import HscMain
-import Finder
import TmpFiles
import HscTypes
import Outputable
-----------------------------------------------------------------------------
-- Hsc phase
+-- Compilation of a single module, in "legacy" mode (_not_ under
+-- the direction of the compilation manager).
run_phase Hsc basename suff input_fn output_fn
= do
-- build a bogus ModSummary to pass to hscMain.
let summary = ModSummary {
+ ms_mod = (mkModuleInThisPackage . mkModuleName)
+ {-ToDo: modname!!-}basename,
ms_location = error "no loc",
ms_ppsource = Just (input_fn, error "no fingerprint"),
ms_imports = error "no imports"
-- run the compiler!
pcs <- initPersistentCompilerState
result <- hscMain dyn_flags{ hscOutName = output_fn }
- (error "no Finder!")
summary
Nothing -- no iface
emptyModuleEnv -- HomeSymbolTable
do pipeline <- genPipeline (StopBefore Hsc) ("preprocess") filename
runPipeline pipeline filename False{-no linking-} False{-no -o flag-}
+
-----------------------------------------------------------------------------
--- Compile a single module.
+-- Compile a single module, under the control of the compilation manager.
--
-- This is the interface between the compilation manager and the
-- compiler proper (hsc), where we deal with tedious details like
-- the .hs file if necessary, and compiling up the .stub_c files to
-- generate Linkables.
-compile :: Finder -- to find modules
- -> ModSummary -- summary, including source
+compile :: ModSummary -- summary, including source
-> Maybe ModIface -- old interface, if available
-> HomeSymbolTable -- for home module ModDetails
-> HomeIfaceTable -- for home module Ifaces
| CompErrs PersistentCompilerState -- updated PCS
-compile finder summary old_iface hst hit pcs = do
+compile summary old_iface hst hit pcs = do
verb <- readIORef v_Verbose
when verb (hPutStrLn stderr
(showSDoc (text "compile: compiling"
-- run the compiler
hsc_result <- hscMain dyn_flags{ hscOutName = output_fn }
- finder summary old_iface hst hit pcs
+ summary old_iface hst hit pcs
case hsc_result of {
HscFail pcs -> return (CompErrs pcs);