X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcoreSyn%2FCoreTidy.lhs;h=11e45b154d9d55db333db473c7c903aecb9293b3;hb=cbbee4e8727c583daf32d9bf17f00afaa839ef10;hp=5acee51f429cd2a4102679d5fe5ecdd8703d78f8;hpb=1370a4a360ec154b390c1da21d40e446739b24c8;p=ghc-hetmet.git diff --git a/compiler/coreSyn/CoreTidy.lhs b/compiler/coreSyn/CoreTidy.lhs index 5acee51..11e45b1 100644 --- a/compiler/coreSyn/CoreTidy.lhs +++ b/compiler/coreSyn/CoreTidy.lhs @@ -11,12 +11,10 @@ module CoreTidy ( tidyExpr, tidyVarOcc, tidyRule, tidyRules ) where --- XXX This define is a bit of a hack, and should be done more nicely -#define FAST_STRING_NOT_NEEDED 1 #include "HsVersions.h" import CoreSyn -import CoreUtils +import CoreArity import Id import IdInfo import Type @@ -178,15 +176,21 @@ tidyIdBndr env@(tidy_env, var_env) id -- though we could extract it from the Id -- -- All nested Ids now have the same IdInfo, namely vanillaIdInfo, - -- which should save some space. + -- which should save some space; except that we hang onto dead-ness + -- (at the moment, solely to make printing tidy core nicer) -- But note that tidyLetBndr puts some of it back. - ty' = tidyType env (idType id) - id' = mkUserLocal occ' (idUnique id) ty' noSrcSpan - `setIdInfo` vanillaIdInfo - var_env' = extendVarEnv var_env id id' + ty' = tidyType env (idType id) + name' = mkInternalName (idUnique id) occ' noSrcSpan + id' = mkLocalIdWithInfo name' ty' new_info + var_env' = extendVarEnv var_env id id' + new_info | isDeadOcc (idOccInfo id) = deadIdInfo + | otherwise = vanillaIdInfo in ((tidy_env', var_env'), id') } + +deadIdInfo :: IdInfo +deadIdInfo = vanillaIdInfo `setOccInfo` IAmDead \end{code} \begin{code}