Merge Haddock comment support from ghc.haddock -- big patch
[ghc-hetmet.git] / compiler / simplCore / SimplUtils.lhs
index cd610a9..b193771 100644 (file)
@@ -52,8 +52,7 @@ import Coercion         ( isEqPredTy
                        )
 import Coercion         ( Coercion, mkUnsafeCoercion, coercionKind )
 import TyCon           ( tyConDataCons_maybe, isClosedNewTyCon )
-import DataCon         ( DataCon, dataConRepArity, dataConExTyVars, 
-                          dataConInstArgTys, dataConTyCon )
+import DataCon         ( DataCon, dataConRepArity, dataConInstArgTys, dataConTyCon )
 import VarSet
 import BasicTypes      ( TopLevelFlag(..), isNotTopLevel, OccInfo(..), isLoopBreaker, isOneOcc,
                          Activation, isAlwaysActive, isActive )
@@ -722,7 +721,8 @@ postInlineUnconditionally
     -> Bool
 postInlineUnconditionally env top_lvl bndr occ_info rhs unfolding
   | not active            = False
-  | isLoopBreaker occ_info = False
+  | isLoopBreaker occ_info = False     -- If it's a loop-breaker of any kind, dont' inline
+                                       -- because it might be referred to "earlier"
   | isExportedId bndr      = False
   | exprIsTrivial rhs     = True
   | otherwise
@@ -789,10 +789,10 @@ postInlineUnconditionally env top_lvl bndr occ_info rhs unfolding
                   SimplPhase n -> isActive n prag
     prag = idInlinePragma bndr
 
-activeInline :: SimplEnv -> OutId -> OccInfo -> Bool
-activeInline env id occ
+activeInline :: SimplEnv -> OutId -> Bool
+activeInline env id
   = case getMode env of
-      SimplGently -> isOneOcc occ && isAlwaysActive prag
+      SimplGently -> False
        -- No inlining at all when doing gentle stuff,
        -- except for local things that occur once
        -- The reason is that too little clean-up happens if you