-----------------------------------------------------------------------------
--- $Id: DriverPipeline.hs,v 1.11 2000/10/30 11:18:14 sewardj Exp $
+-- $Id: DriverPipeline.hs,v 1.12 2000/10/30 13:46:24 sewardj Exp $
--
-- GHC Driver
--
import CmdLineOpts
import Config
import Util
-import MkIface ( pprIface )
import Directory
import System
then return "-fsource-unchanged"
else return ""
- -- 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"
- }
+ -- build a bogus ModuleLocation to pass to hscMain.
+ let location = ModuleLocation {
+ hs_preprocd_file = input_fn,
+ hi_file = hifile,
+ obj_file = o_file
+ }
-- get the DynFlags
dyn_flags <- readIORef v_DynFlags
pcs <- initPersistentCompilerState
result <- hscMain dyn_flags{ hscOutName = output_fn }
(source_unchanged == "-fsource-unchanged")
- summary
+ location
Nothing -- no iface
emptyModuleEnv -- HomeSymbolTable
emptyModuleEnv -- HomeIfaceTable
let input_fn = case ms_ppsource summary of
Just (ppsource, fingerprint) -> ppsource
- Nothing -> hs_file (ms_location summary)
+ Nothing -> hs_preprocd_file (ms_location summary)
when verb (hPutStrLn stderr ("compile: input file " ++ input_fn))
-- run the compiler
hsc_result <- hscMain dyn_flags{ hscOutName = output_fn }
(panic "compile:source_unchanged")
- summary old_iface hst hit pcs
+ (ms_location summary) old_iface hst hit pcs
case hsc_result of {
HscFail pcs -> return (CompErrs pcs);
Nothing -> return (CompOK details Nothing pcs);
Just iface -> do
- let (basename, _) = splitFilename (hs_file (ms_location summary))
+ let (basename, _) = splitFilename (hs_preprocd_file (ms_location summary))
maybe_stub_o <- dealWithStubs basename maybe_stub_h maybe_stub_c
let stub_unlinked = case maybe_stub_o of
Nothing -> []