X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcoreSyn%2FCoreTidy.lhs;h=586f032b32e42fd23faf1df58ad2c0b5b2ea19e8;hb=85f8276b368d39c93e137fa7b0a8a96ab3c6b389;hp=4da1dc33502bacef77b6abb6778dcdb1f5f9c091;hpb=727fae32ea0b6ca6ebdf1b3137649813e4d7ac3d;p=ghc-hetmet.git diff --git a/compiler/coreSyn/CoreTidy.lhs b/compiler/coreSyn/CoreTidy.lhs index 4da1dc3..586f032 100644 --- a/compiler/coreSyn/CoreTidy.lhs +++ b/compiler/coreSyn/CoreTidy.lhs @@ -11,8 +11,6 @@ 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 @@ -22,7 +20,7 @@ import IdInfo import Type import Var import VarEnv -import LazyUniqFM +import UniqFM import Name hiding (tidyNameOcc) import OccName import SrcLoc @@ -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}