diff options
author | Ian Lynagh <igloo@earth.li> | 2011-11-06 22:43:21 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-11-06 22:43:21 +0000 |
commit | 899af3a503dc8365aba02ccfc473d613871790aa (patch) | |
tree | 8d072b02f678a5f6cc2f31fd8ad73b780a98b722 /compiler/simplStg | |
parent | 69e18833778eaa53585db401b0d756711ba09694 (diff) | |
download | haskell-899af3a503dc8365aba02ccfc473d613871790aa.tar.gz |
Whitespace in simplStg/SRT.lhs
Diffstat (limited to 'compiler/simplStg')
-rw-r--r-- | compiler/simplStg/SRT.lhs | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/compiler/simplStg/SRT.lhs b/compiler/simplStg/SRT.lhs index b6947dca4c..178261ceee 100644 --- a/compiler/simplStg/SRT.lhs +++ b/compiler/simplStg/SRT.lhs @@ -7,13 +7,6 @@ each let-binding. At the same time, we figure out which top-level bindings have no CAF references, and record the fact in their IdInfo. \begin{code} -{-# OPTIONS -fno-warn-tabs #-} --- The above warning supression flag is a temporary kludge. --- While working on this module you are encouraged to remove it and --- detab the module (please do the detabbing in a separate patch). See --- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces --- for details - {-# OPTIONS -fno-warn-incomplete-patterns #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and fix @@ -26,10 +19,10 @@ module SRT( computeSRTs ) where #include "HsVersions.h" import StgSyn -import Id ( Id ) +import Id ( Id ) import VarSet import VarEnv -import Maybes ( orElse, expectJust ) +import Maybes ( orElse, expectJust ) import Bitmap import Outputable @@ -50,13 +43,13 @@ computeSRTs binds = srtTopBinds emptyVarEnv binds srtTopBinds :: IdEnv Id -> [StgBinding] -> [(StgBinding, [(Id,[Id])])] srtTopBinds _ [] = [] -srtTopBinds env (StgNonRec b rhs : binds) = +srtTopBinds env (StgNonRec b rhs : binds) = (StgNonRec b rhs', [(b,srt')]) : srtTopBinds env' binds where (rhs', srt) = srtTopRhs b rhs env' = maybeExtendEnv env b rhs srt' = applyEnvList env srt -srtTopBinds env (StgRec bs : binds) = +srtTopBinds env (StgRec bs : binds) = (StgRec (zip bndrs rhss), zip bndrs srts') : srtTopBinds env binds where (rhss, srts) = unzip [ srtTopRhs b r | (b,r) <- bs ] @@ -94,7 +87,7 @@ srtTopRhs _ rhs@(StgRhsCon _ _ _) = (rhs, []) srtTopRhs _ rhs@(StgRhsClosure _ _ _ _ (SRTEntries cafs) _ _) = (srtRhs table rhs, elems) where - elems = varSetElems cafs + elems = varSetElems cafs table = mkVarEnv (zip elems [0..]) -- ---- Binds: @@ -110,8 +103,8 @@ srtRhs :: IdEnv Int -> StgRhs -> StgRhs srtRhs _ e@(StgRhsCon _ _ _) = e srtRhs table (StgRhsClosure cc bi free_vars u srt args body) - = StgRhsClosure cc bi free_vars u (constructSRT table srt) args - $! (srtExpr table body) + = StgRhsClosure cc bi free_vars u (constructSRT table srt) args + $! (srtExpr table body) -- --------------------------------------------------------------------------- -- Expressions @@ -136,12 +129,12 @@ srtExpr table (StgCase scrut live1 live2 uniq srt alt_type alts) srtExpr table (StgLet bind body) = srtBind table bind =: \ bind' -> - srtExpr table body =: \ body' -> + srtExpr table body =: \ body' -> StgLet bind' body' - + srtExpr table (StgLetNoEscape live1 live2 bind body) = srtBind table bind =: \ bind' -> - srtExpr table body =: \ body' -> + srtExpr table body =: \ body' -> StgLetNoEscape live1 live2 bind' body' srtExpr _table expr = pprPanic "srtExpr" (ppr expr) @@ -158,8 +151,8 @@ constructSRT table (SRTEntries entries) | isEmptyVarSet entries = NoSRT | otherwise = seqBitmap bitmap $ SRT offset len bitmap where - ints = map (expectJust "constructSRT" . lookupVarEnv table) - (varSetElems entries) + ints = map (expectJust "constructSRT" . lookupVarEnv table) + (varSetElems entries) sorted_ints = sortLe (<=) ints offset = head sorted_ints bitmap_entries = map (subtract offset) sorted_ints |