X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FTidyPgm.lhs;h=331d921489d4f7cd30cba6914ed7c9bc3308d283;hb=d5934bbb856aa0aa620c9b2e0fa51c90a1a5a048;hp=b95d4d31abcd864179bccfec27e3e640d5994aed;hpb=49c98d143c382a1341e1046f5ca00819a25691ba;p=ghc-hetmet.git diff --git a/compiler/main/TidyPgm.lhs b/compiler/main/TidyPgm.lhs index b95d4d3..331d921 100644 --- a/compiler/main/TidyPgm.lhs +++ b/compiler/main/TidyPgm.lhs @@ -239,7 +239,8 @@ tidyProgram hsc_env mg_binds = binds, mg_rules = imp_rules, mg_dir_imps = dir_imps, mg_deps = deps, - mg_foreign = foreign_stubs }) + mg_foreign = foreign_stubs, + mg_hpc_info = hpc_info }) = do { let dflags = hsc_dflags hsc_env ; showPass dflags "Tidy Core" @@ -290,7 +291,8 @@ tidyProgram hsc_env cg_binds = all_tidy_binds, cg_dir_imps = dir_imps, cg_foreign = foreign_stubs, - cg_dep_pkgs = dep_pkgs deps }, + cg_dep_pkgs = dep_pkgs deps, + cg_hpc_info = hpc_info }, ModDetails { md_types = tidy_type_env, md_rules = tidy_rules, @@ -789,11 +791,17 @@ CAF list to keep track of non-collectable CAFs. \begin{code} hasCafRefs :: PackageId -> VarEnv Var -> Arity -> CoreExpr -> CafInfo hasCafRefs this_pkg p arity expr - | is_caf || mentions_cafs = MayHaveCafRefs + | is_caf || mentions_cafs || is_tick + = MayHaveCafRefs | otherwise = NoCafRefs where mentions_cafs = isFastTrue (cafRefs p expr) is_caf = not (arity > 0 || rhsIsStatic this_pkg expr) + is_tick = case expr of + Note (TickBox {}) _ -> True + Note (BinaryTickBox {}) _ -> True + _ -> False + -- NB. we pass in the arity of the expression, which is expected -- to be calculated by exprArity. This is because exprArity -- knows how much eta expansion is going to be done by