X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fiface%2FTcIface.lhs;h=45cc6ca774e49274b880273bcae4919fa2a635cf;hb=a6f2d598e1e7760d334d1b5ea0b7745e66835e11;hp=fde31465abdfc43db6707dc97b5f081239ea791d;hpb=83a8fc9f6e04436784693a2188a58eac9c3e9664;p=ghc-hetmet.git diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs index fde3146..45cc6ca 100644 --- a/compiler/iface/TcIface.lhs +++ b/compiler/iface/TcIface.lhs @@ -1008,11 +1008,14 @@ tcIdInfo ignore_prags name ty info \begin{code} tcUnfolding :: Name -> Type -> IdInfo -> IfaceUnfolding -> IfL Unfolding -tcUnfolding name _ info (IfCoreUnfold if_expr) +tcUnfolding name _ info (IfCoreUnfold stable if_expr) = do { mb_expr <- tcPragExpr name if_expr + ; let unf_src = if stable then InlineStable else InlineRhs ; return (case mb_expr of - Nothing -> NoUnfolding - Just expr -> mkTopUnfolding is_bottoming expr) } + Nothing -> NoUnfolding + Just expr -> mkUnfolding unf_src + True {- Top level -} + is_bottoming expr) } where -- Strictness should occur before unfolding! is_bottoming = case strictnessInfo info of @@ -1029,7 +1032,7 @@ tcUnfolding name _ _ (IfInlineRule arity unsat_ok boring_ok if_expr) = do { mb_expr <- tcPragExpr name if_expr ; return (case mb_expr of Nothing -> NoUnfolding - Just expr -> mkCoreUnfolding True InlineRule expr arity + Just expr -> mkCoreUnfolding True InlineStable expr arity (UnfWhen unsat_ok boring_ok)) } @@ -1072,7 +1075,7 @@ tcPragExpr name expr core_expr' <- tcIfaceExpr expr -- Check for type consistency in the unfolding - ifOptM Opt_DoCoreLinting $ do + ifDOptM Opt_DoCoreLinting $ do in_scope <- get_in_scope_ids case lintUnfolding noSrcLoc in_scope core_expr' of Nothing -> return ()