From 4c566b1b603e90c44d4fc8f19ff13d76aeb3413a Mon Sep 17 00:00:00 2001 From: simonpj Date: Wed, 24 Oct 2001 14:05:09 +0000 Subject: [PATCH] [project @ 2001-10-24 14:05:09 by simonpj] Wibble --- ghc/compiler/coreSyn/CoreTidy.lhs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ghc/compiler/coreSyn/CoreTidy.lhs b/ghc/compiler/coreSyn/CoreTidy.lhs index 5180c41..4665bd2 100644 --- a/ghc/compiler/coreSyn/CoreTidy.lhs +++ b/ghc/compiler/coreSyn/CoreTidy.lhs @@ -435,7 +435,7 @@ tidyTopBinder mod ext_ids cg_info_env rec_tidy_env rhs (idName id) ty' = tidyTopType (idType id) idinfo = tidyTopIdInfo rec_tidy_env is_external - (idInfo id) unfolding arity + (idInfo id) unfold_info arity (lookupCgInfo cg_info_env name') id' = mkVanillaGlobal name' ty' idinfo @@ -445,14 +445,20 @@ tidyTopBinder mod ext_ids cg_info_env rec_tidy_env rhs maybe_external = lookupVarEnv ext_ids id is_external = isJust maybe_external + -- Expose an unfolding if ext_ids tells us to + -- Remember that ext_ids maps an Id to a Bool: + -- True to show the unfolding, False to hide it + show_unfold = maybe_external `orElse` False + unfold_info | show_unfold = mkTopUnfolding rhs + | otherwise = noUnfolding + -- Usually the Id will have an accurate arity on it, because -- the simplifier has just run, but not always. -- One case I found was when the last thing the simplifier -- did was to let-bind a non-atomic argument and then float -- it to the top level. So it seems more robust just to -- fix it here. - arity = exprArity rhs - unfolding = mkTopUnfolding rhs + arity = exprArity rhs -- 1.7.10.4