module UHC.Light.Compiler.EHC.CompilePhase.Cleanup ( cpCleanupHSMod, cpCleanupHS, cpCleanupFoldEH, cpCleanupEH , cpCleanupCore , cpCleanupCU, cpCleanupFlow ) where import UHC.Light.Compiler.Base.Optimize import UHC.Light.Compiler.EHC.Common import UHC.Light.Compiler.EHC.CompileUnit import UHC.Light.Compiler.EHC.CompileRun import Control.Monad.State {-# LINE 33 "src/ehc/EHC/CompilePhase/Cleanup.chs" #-} cpCleanupHSMod :: EHCCompileRunner m => HsName -> EHCompilePhaseT m () cpCleanupHSMod modNm = cpUpdCU modNm (\e -> e { _ecuMbHSSemMod = Nothing } ) cpCleanupHS :: EHCCompileRunner m => HsName -> EHCompilePhaseT m () cpCleanupHS modNm = cpUpdCU modNm (\e -> e { _ecuMbHS = Nothing , _ecuMbHSSem = Nothing } ) cpCleanupFoldEH :: EHCCompileRunner m => HsName -> EHCompilePhaseT m () cpCleanupFoldEH modNm = cpUpdCU modNm (\e -> e { _ecuMbEH = Nothing } ) cpCleanupEH :: EHCCompileRunner m => HsName -> EHCompilePhaseT m () cpCleanupEH modNm = cpUpdCU modNm (\e -> e { _ecuMbEHSem = Nothing } ) {-# LINE 64 "src/ehc/EHC/CompilePhase/Cleanup.chs" #-} cpCleanupCore :: EHCCompileRunner m => [HsName] -> EHCompilePhaseT m () cpCleanupCore modNmL = cpSeq [cl m | m <- modNmL] where cl m = cpUpdCU m (\e -> e { _ecuMbCore = Nothing , _ecuMbCoreSemMod = Nothing } ) {-# LINE 113 "src/ehc/EHC/CompilePhase/Cleanup.chs" #-} cpCleanupCU :: EHCCompileRunner m => HsName -> EHCompilePhaseT m () cpCleanupCU modNm = do { cpUpdCU modNm (\e -> e { ecuMbOptim = Nothing -- , _ecuHIInfo = {- HI.hiiRetainAfterCleanup -} (_ecuHIInfo e) } ) } cpCleanupFlow :: EHCCompileRunner m => HsName -> EHCompilePhaseT m () cpCleanupFlow modNm = cpUpdCU modNm (\e -> e { _ecuMbHSSemMod = Nothing -- , ecuMbPrevHI = Nothing -- , ecuMbPrevHISem = Nothing -- , _ecuMbPrevHIInfo = Nothing } )