From c64f1799ad995d8cd2447dc0982d2483fa4cc9e1 Mon Sep 17 00:00:00 2001 From: Atze Dijkstra Date: Tue, 13 Oct 2015 20:04:22 +0200 Subject: [PATCH] CoreRun backend running works now with/without Core whole program linking --- EHC/changelog.md.editthis | 1 + EHC/src/ehc/EHC/BuildFunction/Run.chs | 33 ++++++++++------ .../ehc/EHC/CompilePhase/FlowBetweenPhase.chs | 39 ++++++++++++------- EHC/src/ehc/EHC/CompilePhase/Semantics.chs | 14 ++++--- .../ehc/EHC/CompilePhase/TopLevelPhases.chs | 7 +++- .../ehc/EHC/CompilePhase/Transformations.chs | 2 +- EHC/src/ehc/EHC/CompilePhase/Translations.chs | 8 ++-- EHC/src/ehc/EHC/CompileRun/Base.chs | 6 +-- EHC/src/ehc/EHC/InitialSetup.chs | 2 +- EHC/src/ehc/EHC/Main.chs | 4 +- EHC/src/ehc/EHCRun.chs | 12 +++--- 11 files changed, 78 insertions(+), 50 deletions(-) diff --git a/EHC/changelog.md.editthis b/EHC/changelog.md.editthis index a3ab18125..132438d69 100644 --- a/EHC/changelog.md.editthis +++ b/EHC/changelog.md.editthis @@ -1,4 +1,5 @@ - [guarantees] This is a pre-release as far as below extensions is concerned. +- [backend] Core/CoreRun backend now better supported (e.g. via uhcl/uhcr) to allow CoreRun modules to be run, without requiring -Operwholecore (Core whole program linking). - [extension] Local instances have been resurrected, paper submitted to flops2016 describes what can be done. Still bugs and design issues to be sorted out. - [extension] Generic deriving now by default off, can be turned on via deriving Generic addition to datatype def. - [compatibility] Compatibility with ghc <7.10 versions no longer guaranteed. diff --git a/EHC/src/ehc/EHC/BuildFunction/Run.chs b/EHC/src/ehc/EHC/BuildFunction/Run.chs index e925b2c07..fbf2ba552 100644 --- a/EHC/src/ehc/EHC/BuildFunction/Run.chs +++ b/EHC/src/ehc/EHC/BuildFunction/Run.chs @@ -236,18 +236,19 @@ bcall bfun = do cpTrPP TraceOn_BldFlow ["ASTSemFlowStage_BetweenModule astpMbSrcCachedCore" >#< modSearchKey, pp p] bcall $ FoldCoreModPlMb modSearchKey pl ) (return id) $ \_ (coreChkSem, _, _, _, _, _) -> do - -- 20151008 AD: TBD: dataGam needs independent passing around return $ \crsi -> let cenv = cenvDataGam ^$= (`gamUnion` Core2ChkSem.gathDataGam_Syn_CodeAGItf coreChkSem) $ crsi ^. crsiCEnv in ( ( crsiCEnv ^= cenv ) %%[[(50 grin) +{- . ( crsiCoreInh ^$= \coreInh -> coreInh -- { Core2GrSem.dataGam_Inh_CodeAGItf = Core2GrSem.dataGam_Inh_CodeAGItf coreInh `gamUnion` Core2ChkSem.gathDataGam_Syn_CodeAGItf coreChkSem } {Core2GrSem.dataGam_Inh_CodeAGItf = cenv ^. cenvDataGam} + ) +-} %%]] - ) ) - $ crsi + ) $ crsi %%][50 let updCoreSrc = id %%]] @@ -280,13 +281,15 @@ bcall bfun = do return $ \crsi -> let cenv = cenvLamMp ^$= (Core2GrSem.gathLamMp_Syn_CodeAGItf core2GrinSem `lamMpUnionBindAspMp`) $ crsi ^. crsiCEnv in ( ( crsiCEnv ^= cenv ) +{- . ( crsiCoreInh ^$= \coreInh -> coreInh -- assumption: old info can safely be overridden, otherwise merge should be done here -- { Core2GrSem.lamMp_Inh_CodeAGItf = Core2GrSem.gathLamMp_Syn_CodeAGItf core2GrinSem `lamMpUnionBindAspMp` Core2GrSem.lamMp_Inh_CodeAGItf coreInh } { Core2GrSem.lamMp_Inh_CodeAGItf = cenv ^. cenvLamMp } - ) ) - $ crsi + ) +-} + ) $ crsi %%][50 let updCoreGrin = id @@ -415,7 +418,7 @@ bcall bfun = do ) (return ()) $ \_ ehSem -> do cpUpdSI $ \crsi -> let ehInh = crsi ^. crsiEHInh - coreInh = crsi ^. crsiCoreInh + -- coreInh = crsi ^. crsiCoreInh cenv = crsi ^. crsiCEnv lm = EHSem.gathLamMp_Syn_AGItf ehSem cenv' = ( cenvDataGam ^$= (EHSem.gathDataGam_Syn_AGItf ehSem `gamUnion`) ) @@ -423,6 +426,7 @@ bcall bfun = do . ( cenvLamMp ^$= (EHSem.gathLamMp_Syn_AGItf ehSem `lamMpUnionBindAspMp`) ) -- assumption: no duplicates, otherwise merging as done later has to be done %%]] $ cenv +{- coreInh' = coreInh %%[[8 { Core2GrSem.dataGam_Inh_CodeAGItf = cenv' ^. cenvDataGam -- EHSem.gathDataGam_Syn_AGItf ehSem @@ -432,8 +436,9 @@ bcall bfun = do , Core2GrSem.lamMp_Inh_CodeAGItf = cenv' ^. cenvLamMp -- lm `lamMpUnionBindAspMp` Core2GrSem.lamMp_Inh_CodeAGItf coreInh -- assumption: no duplicates, otherwise merging as done later has to be done %%]] } +-} in crsi -- From: cpFlowEHSem1 - { _crsiCoreInh = coreInh', _crsiCEnv = cenv' } + { {- _crsiCoreInh = coreInh', -} _crsiCEnv = cenv' } %%]] brefto bfun BRef_CRSI @@ -1211,15 +1216,19 @@ ecuIsHSNewerThanHI ecu ecu <- bcall $ EcuOfPrevNameAndPath modSearchKey opts <- bcall $ EHCOptsOf modSearchKey crsi <- bcall $ CRSIOfNamePl bglob modSearchKey astplan - let coreInh = _crsiCoreInh crsi + let -- coreInh = _crsiCoreInh crsi + cenv = crsi ^. crsiCEnv coreSem = Core2GrSem.wrap_CodeAGItf (Core2GrSem.sem_CodeAGItf (Core.CodeAGItf_AGItf core)) - (coreInh { Core2GrSem.gUniq_Inh_CodeAGItf = crsi ^. crsiHereUID - , Core2GrSem.opts_Inh_CodeAGItf = opts + (Core2GrSem.Inh_CodeAGItf -- coreInh + { Core2GrSem.gUniq_Inh_CodeAGItf = crsi ^. crsiHereUID + , Core2GrSem.opts_Inh_CodeAGItf = opts + , Core2GrSem.dataGam_Inh_CodeAGItf = cenv ^. cenvDataGam + , Core2GrSem.lamMp_Inh_CodeAGItf = cenv ^. cenvLamMp %%[[50 - , Core2GrSem.importUsedModules_Inh_CodeAGItf = ecuImportUsedModules ecu + , Core2GrSem.importUsedModules_Inh_CodeAGItf = ecuImportUsedModules ecu %%]] - }) + }) bUpdECU modNm $ ecuStoreCoreSem coreSem breturn $ Just coreSem %%]] diff --git a/EHC/src/ehc/EHC/CompilePhase/FlowBetweenPhase.chs b/EHC/src/ehc/EHC/CompilePhase/FlowBetweenPhase.chs index d7a209e8e..8b1c008f4 100644 --- a/EHC/src/ehc/EHC/CompilePhase/FlowBetweenPhase.chs +++ b/EHC/src/ehc/EHC/CompilePhase/FlowBetweenPhase.chs @@ -152,7 +152,7 @@ cpFlowEHSem1 modNm ehInh = crsi ^. crsiEHInh cenv = crsi ^. crsiCEnv %%[[(8 core grin) - coreInh = _crsiCoreInh crsi + -- coreInh = _crsiCoreInh crsi %%]] dg = prepFlow $! EHSem.gathDataGam_Syn_AGItf ehSem %%[[(50 hmtyinfer) @@ -168,6 +168,11 @@ cpFlowEHSem1 modNm %%[[(8 core) lm = prepFlow $! EHSem.gathLamMp_Syn_AGItf ehSem %%]] + cenv' = ( cenvDataGam ^$= (dg `gamUnionFlow`) ) +%%[[(8 core) + . ( cenvLamMp ^$= (lm `lamMpUnionBindAspMp`) ) -- assumption: no duplicates, otherwise merging as done later has to be done +%%]] + $ cenv %%[[50 mmi = panicJust "cpFlowEHSem1.crsiModMp" $ Map.lookup modNm $ crsiModMp crsi hii = ecu ^. ecuHIInfo @@ -178,11 +183,6 @@ cpFlowEHSem1 modNm = mentrelToFilterMp' False [modNm] (mmiExps mmi) %%]] usedImpS = mentrelFilterMpModuleNames mentrelFilterMp - cenv' = ( cenvDataGam ^$= (dg `gamUnionFlow`) ) -%%[[(8 core) - . ( cenvLamMp ^$= (lm `lamMpUnionBindAspMp`) ) -- assumption: no duplicates, otherwise merging as done later has to be done -%%]] - $ cenv ehInh' = ehInh %%[[(50 hmtyinfer) { -- EHSem.dataGam_Inh_AGItf = dg `gamUnionFlow` EHSem.dataGam_Inh_AGItf ehInh @@ -217,6 +217,7 @@ cpFlowEHSem1 modNm } %%]] %%[[(8 core grin) +{- coreInh' = coreInh %%[[8 { Core2GrSem.dataGam_Inh_CodeAGItf = cenv' ^. cenvDataGam -- EHSem.gathDataGam_Syn_AGItf ehSem @@ -226,14 +227,15 @@ cpFlowEHSem1 modNm , Core2GrSem.lamMp_Inh_CodeAGItf = cenv' ^. cenvLamMp -- lm `lamMpUnionBindAspMp` Core2GrSem.lamMp_Inh_CodeAGItf coreInh -- assumption: no duplicates, otherwise merging as done later has to be done %%]] } +-} %%]] ; when (isJust (_ecuMbEHSem ecu)) (do { cpUpdSI (\crsi -> crsi %%[[(8 core grin) - { _crsiCoreInh = coreInh', _crsiCEnv = cenv' } + { {- _crsiCoreInh = coreInh', -} _crsiCEnv = cenv' } %%][(50 core grin) - { _crsiCoreInh = coreInh', _crsiCEnv = cenv', _crsiEHInh = ehInh' } + { {- _crsiCoreInh = coreInh', -} _crsiCEnv = cenv', _crsiEHInh = ehInh' } %%][50 { _crsiEHInh = ehInh', _crsiCEnv = cenv' } %%]] @@ -293,11 +295,13 @@ cpFlowHISem modNm , HSSem.idGam_Inh_AGItf = (HI.hiiIdDefOccGam hiInfo) `gamUnionFlow` HSSem.idGam_Inh_AGItf hsInh } %%[[(50 core grin) +{- coreInh = crsi ^. crsiCoreInh coreInh' = coreInh { -- Core2GrSem.lamMp_Inh_CodeAGItf = (HI.hiiLamMp hiInfo) `lamMpUnionBindAspMp` Core2GrSem.lamMp_Inh_CodeAGItf coreInh Core2GrSem.lamMp_Inh_CodeAGItf = cenv' ^. cenvLamMp } +-} %%]] optim = crsiOptim crsi optim' = optim @@ -310,7 +314,7 @@ cpFlowHISem modNm , _crsiHSInh = hsInh' , _crsiCEnv = cenv' %%[[(50 core grin) - , _crsiCoreInh = coreInh' + -- , _crsiCoreInh = coreInh' %%]] , crsiOptim = optim' }) @@ -325,23 +329,24 @@ cpFlowCoreModSem modNm = do { cr <- get ; let (ecu,crsi,opts,_) = crBaseInfo modNm cr %%[[(50 grin) - coreInh = crsi ^. crsiCoreInh + -- coreInh = crsi ^. crsiCoreInh %%]] mbCoreModSem = _ecuMbCoreSemMod ecu - -- 20151008 AD: TBD: dataGam should be passed independently of Core etc. ; when (isJust mbCoreModSem) $ do { let coreModSem = fromJust mbCoreModSem cenv = cenvDataGam ^$= (`gamUnionFlow` Core2ChkSem.gathDataGam_Syn_CodeAGItf coreModSem) $ crsi ^. crsiCEnv %%[[(50 grin) +{- coreInh' = coreInh { -- Core2GrSem.dataGam_Inh_CodeAGItf = Core2GrSem.dataGam_Inh_CodeAGItf coreInh `gamUnionFlow` Core2ChkSem.gathDataGam_Syn_CodeAGItf coreModSem Core2GrSem.dataGam_Inh_CodeAGItf = cenv ^. cenvDataGam } +-} %%]] ; cpUpdSI $ ( crsiCEnv ^= cenv ) %%[[(50 grin) - . ( crsiCoreInh ^= coreInh' ) + -- . ( crsiCoreInh ^= coreInh' ) %%]] } } @@ -358,12 +363,14 @@ cpFlowCoreSemAfterFold modNm lm = prepFlow $! Core2GrSem.gathLamMp_Syn_CodeAGItf coreSem cenv = cenvLamMp ^$= (lm `lamMpUnionBindAspMp`) $ crsi ^. crsiCEnv -- assumption: old info can be overridden, otherwise merge should be done here %%[[50 +{- coreInh = crsi ^. crsiCoreInh - hii = ecu ^. ecuHIInfo coreInh' = coreInh { -- Core2GrSem.lamMp_Inh_CodeAGItf = lm `lamMpUnionBindAspMp` Core2GrSem.lamMp_Inh_CodeAGItf coreInh -- assumption: old info can be overridden, otherwise merge should be done here Core2GrSem.lamMp_Inh_CodeAGItf = cenv ^. cenvLamMp } +-} + hii = ecu ^. ecuHIInfo hii' = hii { HI.hiiLamMp = lm } @@ -372,7 +379,7 @@ cpFlowCoreSemAfterFold modNm (do { cpUpdSI $ ( crsiCEnv ^= cenv ) %%[[50 - . ( crsiCoreInh ^= coreInh') + -- . ( crsiCoreInh ^= coreInh') ; cpUpdCU modNm ( ecuStoreHIInfo hii' ) %%]] @@ -418,7 +425,7 @@ cpFlowHILamMp modNm = do { cr <- get ; let (ecu,crsi,opts,_) = crBaseInfo modNm cr %%[[(50 grin) - coreInh = crsi ^. crsiCoreInh + -- coreInh = crsi ^. crsiCoreInh %%]] cenv = cenvLamMp ^$= (HI.hiiLamMp hii `lamMpUnionBindAspMp`) $ crsi ^. crsiCEnv -- assumption: old info can be overridden, otherwise merge should be done here hii = ecu ^. ecuHIInfo @@ -427,10 +434,12 @@ cpFlowHILamMp modNm ; cpUpdSI $ ( crsiCEnv ^= cenv ) %%[[(50 grin) +{- . ( crsiCoreInh ^= coreInh -- { Core2GrSem.lamMp_Inh_CodeAGItf = HI.hiiLamMp hii `lamMpUnionBindAspMp` Core2GrSem.lamMp_Inh_CodeAGItf coreInh } { Core2GrSem.lamMp_Inh_CodeAGItf = cenv ^. cenvLamMp } ) +-} %%]] } %%] diff --git a/EHC/src/ehc/EHC/CompilePhase/Semantics.chs b/EHC/src/ehc/EHC/CompilePhase/Semantics.chs index 5828f27fe..43f583158 100644 --- a/EHC/src/ehc/EHC/CompilePhase/Semantics.chs +++ b/EHC/src/ehc/EHC/CompilePhase/Semantics.chs @@ -79,15 +79,19 @@ cpFoldCore2Grin modNm ; let (ecu,crsi,opts,_) = crBaseInfo modNm cr mbCore = _ecuMbCore ecu core = panicJust "cpFoldCore2Grin" mbCore - coreInh = crsi ^. crsiCoreInh + cenv = crsi ^. crsiCEnv + -- coreInh = crsi ^. crsiCoreInh coreSem = Core2GrSem.wrap_CodeAGItf (Core2GrSem.sem_CodeAGItf (Core.CodeAGItf_AGItf core)) - (coreInh { Core2GrSem.gUniq_Inh_CodeAGItf = crsi ^. crsiHereUID - , Core2GrSem.opts_Inh_CodeAGItf = opts + (Core2GrSem.Inh_CodeAGItf -- coreInh + { Core2GrSem.gUniq_Inh_CodeAGItf = crsi ^. crsiHereUID + , Core2GrSem.opts_Inh_CodeAGItf = opts + , Core2GrSem.dataGam_Inh_CodeAGItf = cenv ^. cenvDataGam + , Core2GrSem.lamMp_Inh_CodeAGItf = cenv ^. cenvLamMp %%[[50 - , Core2GrSem.importUsedModules_Inh_CodeAGItf = ecuImportUsedModules ecu + , Core2GrSem.importUsedModules_Inh_CodeAGItf = ecuImportUsedModules ecu %%]] - }) + }) ; when (isJust mbCore) (cpUpdCU modNm ( ecuStoreCoreSem coreSem )) diff --git a/EHC/src/ehc/EHC/CompilePhase/TopLevelPhases.chs b/EHC/src/ehc/EHC/CompilePhase/TopLevelPhases.chs index d47cbf1f9..854ca56b4 100644 --- a/EHC/src/ehc/EHC/CompilePhase/TopLevelPhases.chs +++ b/EHC/src/ehc/EHC/CompilePhase/TopLevelPhases.chs @@ -1135,7 +1135,7 @@ cpEhcCorePerModulePart2 modNm } %%] -%%[(8 codegen corerunin) +%%[(8888 codegen corerunin) -- | Part 2 CoreRun processing, part2 is done either for per individual module compilation or after full program analysis cpEhcCoreRunPerModulePart2 :: EHCCompileRunner m => HsName -> EHCompilePhaseT m () cpEhcCoreRunPerModulePart2 = cpProcessCoreRunRest @@ -1298,9 +1298,11 @@ cpProcessCoreBasic modNm %%]] , cpProcessCoreFold modNm %%[[(50 corerun) +{- , when (targetIsCoreVariation (ehcOptTarget opts)) $ void $ -- cpOutputCoreRun ASTFileContent_Binary "" Cfg.suffixDotlessBinaryCoreRun modNm cpOutputSomeModule (^. ecuCoreRun) astHandler'_CoreRun ASTFileContent_Binary "" Cfg.suffixDotlessBinaryCoreRun modNm +-} %%]] ] } @@ -1405,6 +1407,9 @@ cpProcessCoreRunRest modNm -- [cpRunCoreRun2 modNm] -- [cpRunCoreRun3 modNm] else []) + ++ (if targetIsCoreVariation (ehcOptTarget opts) + then [void $ cpOutputSomeModule (^. ecuCoreRun) astHandler'_CoreRun ASTFileContent_Binary "" Cfg.suffixDotlessInputOutputBinaryCoreRun modNm] + else []) ) } diff --git a/EHC/src/ehc/EHC/CompilePhase/Transformations.chs b/EHC/src/ehc/EHC/CompilePhase/Transformations.chs index fc2257112..41c928d56 100644 --- a/EHC/src/ehc/EHC/CompilePhase/Transformations.chs +++ b/EHC/src/ehc/EHC/CompilePhase/Transformations.chs @@ -88,7 +88,7 @@ cpTransformCore optimScope modNm -- transform ; let mbCore = _ecuMbCore ecu %%[[(8 grin) - coreInh = crsi ^. crsiCoreInh + -- coreInh = crsi ^. crsiCoreInh %%]] trfcoreIn = emptyTrfCore { trfstMod = panicJust "cpTransformCore" mbCore diff --git a/EHC/src/ehc/EHC/CompilePhase/Translations.chs b/EHC/src/ehc/EHC/CompilePhase/Translations.chs index 7d5400c14..29e09759b 100644 --- a/EHC/src/ehc/EHC/CompilePhase/Translations.chs +++ b/EHC/src/ehc/EHC/CompilePhase/Translations.chs @@ -262,7 +262,7 @@ cpTranslateCore2JavaScript modNm = do { cr <- get ; let (ecu,crsi,opts,fp) = crBaseInfo modNm cr mbCore = _ecuMbCore ecu - coreInh = crsi ^. crsiCoreInh + -- coreInh = crsi ^. crsiCoreInh ; when (isJust mbCore) $ cpUpdCU modNm $ ecuStoreJavaScript @@ -302,7 +302,7 @@ cpTranslateGrin2Cmm modNm = do { cr <- get ; let (ecu,crsi,opts,fp) = crBaseInfo modNm cr mbGrin = _ecuMbGrin ecu - coreInh = crsi ^. crsiCoreInh + -- coreInh = crsi ^. crsiCoreInh %%[[50 ; (lamMp, allImpNmL, impNmFldMpMp, expNmFldMp) <- cpGenGrinGenInfo modNm %%]] @@ -327,7 +327,7 @@ cpTranslateCmm2JavaScript modNm = do { cr <- get ; let (ecu,crsi,opts,fp) = crBaseInfo modNm cr mbCmm = _ecuMbCmm ecu - coreInh = crsi ^. crsiCoreInh + -- coreInh = crsi ^. crsiCoreInh ; when (isJust mbCmm) $ do let (jsmod,errs) = cmmMod2JavaScript opts @@ -404,7 +404,7 @@ cpTranslateByteCode modNm grinbcCmm = Cmm.Module_Mod modNm cmmMod Nothing Const.emptyConstSt %%]] %%][50 - coreInh = crsi ^. crsiCoreInh + -- coreInh = crsi ^. crsiCoreInh ( grinbcPP %%[[(50 cmm cmmbc) ,grinbcCmm diff --git a/EHC/src/ehc/EHC/CompileRun/Base.chs b/EHC/src/ehc/EHC/CompileRun/Base.chs index 3f460d347..66e35f4f8 100644 --- a/EHC/src/ehc/EHC/CompileRun/Base.chs +++ b/EHC/src/ehc/EHC/CompileRun/Base.chs @@ -975,7 +975,7 @@ data EHCompileRunStateInfo (m :: * -> *) , _crsiCEnv :: CEnv -- globally required codegen info -- 20151009 AD: TBD, for now non strict field %%[[(8 core grin) - , _crsiCoreInh :: !AST_Core_Inh_ToGrin -- current inh attrs for Core2Grin sem + -- , _crsiCoreInh :: !AST_Core_Inh_ToGrin -- current inh attrs for Core2Grin sem %%]] %%[[(8 corerun) , _crsiCoreRunState :: !EHCompileRunCoreRunStateInfo -- corerun compilation specific state @@ -1013,7 +1013,7 @@ emptyEHCompileRunStateInfo , _crsiFileSuffMp = emptyFileSuffMp , _crsiCEnv = emptyCEnv %%[[(8 core grin) - , _crsiCoreInh = panic "emptyEHCompileRunStateInfo.crsiCoreInh" + -- , _crsiCoreInh = panic "emptyEHCompileRunStateInfo.crsiCoreInh" %%]] %%[[(8 corerun) , _crsiCoreRunState = emptyEHCompileRunCoreRunStateInfo @@ -1170,7 +1170,7 @@ mkLabel ''EHCompileRunStateInfo %%[8 export(crsiCEnv) %%] -%%[(8 core grin) export(crsiCoreInh) +%%[(8888 core grin) export(crsiCoreInh) %%] %%[(8888 corerun) export(crsiCore2RunInh) diff --git a/EHC/src/ehc/EHC/InitialSetup.chs b/EHC/src/ehc/EHC/InitialSetup.chs index ab9ab6623..e14ab4bb5 100644 --- a/EHC/src/ehc/EHC/InitialSetup.chs +++ b/EHC/src/ehc/EHC/InitialSetup.chs @@ -106,7 +106,7 @@ initialEHSem opts fp } %%] -%%[(8 codegen) export(initialCore2GrSem) +%%[(8888 codegen) export(initialCore2GrSem) initialCore2GrSem :: EHCOpts -> Core2GrSem.Inh_CodeAGItf initialCore2GrSem opts = Core2GrSem.Inh_CodeAGItf diff --git a/EHC/src/ehc/EHC/Main.chs b/EHC/src/ehc/EHC/Main.chs index c5732a86d..6b99a44c9 100644 --- a/EHC/src/ehc/EHC/Main.chs +++ b/EHC/src/ehc/EHC/Main.chs @@ -347,7 +347,7 @@ doCompilePrepare fnL@(fn:_) opts , _crsiHSInh = initialHSSem opts3 , _crsiEHInh = initialEHSem opts3 fp %%[[(8 core grin) - , _crsiCoreInh = initialCore2GrSem opts3 + -- , _crsiCoreInh = initialCore2GrSem opts3 %%]] %%[[50 -- , crsiHIInh = initialHISem opts3 @@ -363,7 +363,7 @@ doCompilePrepare fnL@(fn:_) opts (mkFileSuffMpHs opts3) (initialCEnv) %%[[(8 core grin) - (initialCore2GrSem opts3) + -- (initialCore2GrSem opts3) %%]] %%[[(8 corerun) initialCoreRunState diff --git a/EHC/src/ehc/EHCRun.chs b/EHC/src/ehc/EHCRun.chs index 0685a4da0..f86536cc3 100644 --- a/EHC/src/ehc/EHCRun.chs +++ b/EHC/src/ehc/EHCRun.chs @@ -36,26 +36,26 @@ main = do %%]] oo@(o,n,errs) = ehcrunCmdLineOptsApply args opts0 opts = maybe opts0 id o + exts = [ "bcrr", "tcrr", "bcr", "tcr" ] case ehcOptImmQuit opts of - Just immq -> handleImmQuitOption ehcrunCmdLineOpts ["rcr", "bcrr", "tcrr", "cr", "bcr", "tcr"] immq opts + Just immq -> handleImmQuitOption ehcrunCmdLineOpts exts immq opts _ -> case (n,errs) of ([fname], []) -> do let (bname,ext) = splitExtension fname case ext of - -- ".tcrr" -> runRCR opts fname - ".crr" -> runRCR opts fname - e | e `elem` [".cr", ".bcr", ".tcr", ".bcrr", ".tcrr"] + e | e `elem` map ('.':) exts -> mainEHC $ opts { ehcOptMbTarget = JustOk Target_None_Core_AsIs , ehcOptCoreOpts = {- CoreOpt_RunTrace : -} CoreOpt_Run : CoreOpt_LoadOnly : ehcOptCoreOpts opts %%[[50 - , ehcOptOptimizationScope = OptimizationScope_WholeCore + -- required only for original compiler driver + -- , ehcOptOptimizationScope = OptimizationScope_WholeCore %%]] , ehcOptVerbosity = VerboseQuiet , ehcOptAltDriver = not $ ehcOptAltDriver opts } - _ -> return () + _ -> handleImmQuitOption ehcrunCmdLineOpts exts ImmediateQuitOption_Help opts (_ , es) -> do putStr (head errs) exitFailure