import DataCon (DataCon, dataConTag)
import TypeRep (Type(..))
import Type (isTypeKind)
-import HscTypes (PersistentCompilerState, ModGuts(..),
- ModGuts, HscEnv(..) )
+import HscTypes ( ModGuts(..), ModGuts, HscEnv(..), hscEPS )
import CoreFVs (exprFreeVars)
import CoreSyn (Expr(..), Bind(..), Alt(..), AltCon(..), Note(..),
CoreBndr, CoreExpr, CoreBind, mkLams, mkLets,
-- compiling a complete module (EXPORTED)
--
flatten :: HscEnv
- -> PersistentCompilerState
-> ModGuts
-> IO ModGuts
-flatten hsc_env pcs mod_impl@(ModGuts {mg_binds = binds})
+flatten hsc_env mod_impl@(ModGuts {mg_binds = binds})
| not opt_Flatten = return mod_impl -- skip without -fflatten
| otherwise =
do
let dflags = hsc_dflags hsc_env
+ eps <- hscEPS hsc_env
us <- mkSplitUniqSupply 'l' -- 'l' as in fLattening
--
-- announce vectorisation
--
-- vectorise all toplevel bindings
--
- let binds' = runFlatten hsc_env pcs us $ vectoriseTopLevelBinds binds
+ let binds' = runFlatten hsc_env eps us $ vectoriseTopLevelBinds binds
--
-- and dump the result if requested
--
-- compiling a single expression in interactive mode (EXPORTED)
--
flattenExpr :: HscEnv
- -> PersistentCompilerState
-> CoreExpr -- the expression to be flattened
-> IO CoreExpr
-flattenExpr hsc_env pcs expr
+flattenExpr hsc_env expr
| not opt_Flatten = return expr -- skip without -fflatten
| otherwise =
do
let dflags = hsc_dflags hsc_env
+ eps <- hscEPS hsc_env
us <- mkSplitUniqSupply 'l' -- 'l' as in fLattening
--
--
-- vectorise the expression
--
- let expr' = fst . runFlatten hsc_env pcs us $ vectorise expr
+ let expr' = fst . runFlatten hsc_env eps us $ vectorise expr
--
-- and dump the result if requested
--