diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2011-09-23 09:57:42 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2011-09-23 09:57:42 +0100 |
commit | 488e21c8cf07340c4d2f86f8177825a321cb312d (patch) | |
tree | bee6beca864278f07500d23c98073db1277af649 /compiler/simplCore/CoreMonad.lhs | |
parent | f3c7ed721133d53f81d945ecb737a77c2ef6ef73 (diff) | |
download | haskell-488e21c8cf07340c4d2f86f8177825a321cb312d.tar.gz |
Make a new type synonym CoreProgram = [CoreBind]
and comment its invariants in Note [CoreProgram] in CoreSyn
I'm not totally convinced that CoreProgram is the right name
(perhaps CoreTopBinds might better), but it is useful to have
a clue that you are looking at the top-level bindings.
This is only a matter of a type synonym change; no deep
refactoring here.
Diffstat (limited to 'compiler/simplCore/CoreMonad.lhs')
-rw-r--r-- | compiler/simplCore/CoreMonad.lhs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/simplCore/CoreMonad.lhs b/compiler/simplCore/CoreMonad.lhs index df515d1d52..6ad402c789 100644 --- a/compiler/simplCore/CoreMonad.lhs +++ b/compiler/simplCore/CoreMonad.lhs @@ -128,7 +128,7 @@ stuff before and after core passes, and do Core Lint when necessary. showPass :: DynFlags -> CoreToDo -> IO () showPass dflags pass = Err.showPass dflags (showSDoc (ppr pass)) -endPass :: DynFlags -> CoreToDo -> [CoreBind] -> [CoreRule] -> IO () +endPass :: DynFlags -> CoreToDo -> CoreProgram -> [CoreRule] -> IO () endPass dflags pass binds rules = do { dumpPassResult dflags mb_flag (ppr pass) empty binds rules ; lintPassResult dflags pass binds } @@ -147,7 +147,7 @@ dumpPassResult :: DynFlags -- name is specified by df -> SDoc -- Header -> SDoc -- Extra info to appear after header - -> [CoreBind] -> [CoreRule] + -> CoreProgram -> [CoreRule] -> IO () dumpPassResult dflags mb_flag hdr extra_info binds rules | Just dflag <- mb_flag @@ -169,7 +169,7 @@ dumpPassResult dflags mb_flag hdr extra_info binds rules , ptext (sLit "------ Local rules for imported ids --------") , pprRules rules ] -lintPassResult :: DynFlags -> CoreToDo -> [CoreBind] -> IO () +lintPassResult :: DynFlags -> CoreToDo -> CoreProgram -> IO () lintPassResult dflags pass binds = when (dopt Opt_DoCoreLinting dflags) $ do { let (warns, errs) = lintCoreBindings binds @@ -177,7 +177,7 @@ lintPassResult dflags pass binds ; displayLintResults dflags pass warns errs binds } displayLintResults :: DynFlags -> CoreToDo - -> Bag Err.Message -> Bag Err.Message -> [CoreBind] + -> Bag Err.Message -> Bag Err.Message -> CoreProgram -> IO () displayLintResults dflags pass warns errs binds | not (isEmptyBag errs) @@ -444,7 +444,7 @@ defaultPlugin = Plugin { -- | A description of the plugin pass itself type PluginPass = ModGuts -> CoreM ModGuts -bindsOnlyPass :: ([CoreBind] -> CoreM [CoreBind]) -> ModGuts -> CoreM ModGuts +bindsOnlyPass :: (CoreProgram -> CoreM CoreProgram) -> ModGuts -> CoreM ModGuts bindsOnlyPass pass guts = do { binds' <- pass (mg_binds guts) ; return (guts { mg_binds = binds' }) } |