Commit 0372ac23 authored by David Himmelstrup's avatar David Himmelstrup
Browse files

Bug fix in the new HscMain code.

I'm not sure what really happens here but this is how it's
done in the old HscMain code and it appears to work.
parent ee63e6dd
......@@ -279,7 +279,7 @@ hscCompileOneShot hsc_env mod_summary =
nonBootComp inp = hscSimplify inp >>= hscNormalIface >>=
hscWriteIface >>= hscOneShot
-- How to compile boot files.
bootComp inp = hscBootIface inp >>= hscWriteIface >>= hscConst (HscRecomp False)
bootComp inp = hscSimpleIface inp >>= hscWriteIface >>= hscConst (HscRecomp False)
compiler
= case ms_hsc_src mod_summary of
ExtCoreFile
......@@ -296,7 +296,7 @@ hscCompileBatch hsc_env mod_summary
where mkComp = hscMkCompiler norecompBatch (batchMsg False)
nonBootComp inp = hscSimplify inp >>= hscNormalIface >>=
hscWriteIface >>= hscBatch
bootComp inp = hscBootIface inp >>= hscWriteIface >>= hscNothing
bootComp inp = hscSimpleIface inp >>= hscWriteIface >>= hscNothing
compiler
= case ms_hsc_src mod_summary of
ExtCoreFile
......@@ -311,16 +311,15 @@ hscCompileNothing :: Compiler (HscStatus, ModIface, ModDetails)
hscCompileNothing hsc_env mod_summary
= compiler hsc_env mod_summary
where mkComp = hscMkCompiler norecompBatch (batchMsg False)
nonBootComp inp = hscNormalIface inp >>= hscIgnoreIface >>= hscNothing
bootComp inp = hscBootIface inp >>= hscIgnoreIface >>= hscNothing
pipeline inp = hscSimpleIface inp >>= hscIgnoreIface >>= hscNothing
compiler
= case ms_hsc_src mod_summary of
ExtCoreFile
-> mkComp hscCoreFrontEnd nonBootComp
-> mkComp hscCoreFrontEnd pipeline
HsSrcFile
-> mkComp hscFileFrontEnd nonBootComp
-> mkComp hscFileFrontEnd pipeline
HsBootFile
-> mkComp hscFileFrontEnd bootComp
-> mkComp hscFileFrontEnd pipeline
-- Compile Haskell, extCore to bytecode.
hscCompileInteractive :: Compiler (InteractiveStatus, ModIface, ModDetails)
......@@ -480,8 +479,8 @@ hscSimplify ds_result
-- HACK: we return ModGuts even though we know it's not gonna be used.
-- We do this because the type signature needs to be identical
-- in structure to the type of 'hscNormalIface'.
hscBootIface :: ModGuts -> Comp (ModIface, Bool, ModDetails, ModGuts)
hscBootIface ds_result
hscSimpleIface :: ModGuts -> Comp (ModIface, Bool, ModDetails, ModGuts)
hscSimpleIface ds_result
= do hsc_env <- gets compHscEnv
mod_summary <- gets compModSummary
maybe_old_iface <- gets compOldIface
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment