X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FbasicTypes%2FVar.lhs;h=0e282c2a2152a05c2de6d7fe26fee1255c743fe5;hb=5f3bef9e47e5ba78983c5081eacaee00f953279d;hp=350986ed4670f0d4b50c5ad0a3195bcd2bb801b7;hpb=be5bbcf6d33d0e998d8acac8d2af557c0c9752a9;p=ghc-hetmet.git diff --git a/ghc/compiler/basicTypes/Var.lhs b/ghc/compiler/basicTypes/Var.lhs index 350986e..0e282c2 100644 --- a/ghc/compiler/basicTypes/Var.lhs +++ b/ghc/compiler/basicTypes/Var.lhs @@ -13,7 +13,7 @@ module Var ( TyVar, mkTyVar, mkTcTyVar, tyVarName, tyVarKind, setTyVarName, setTyVarUnique, - tcTyVarRef, tcTyVarDetails, + tcTyVarDetails, -- Ids Id, DictId, @@ -34,9 +34,8 @@ module Var ( #include "HsVersions.h" import {-# SOURCE #-} TypeRep( Type ) -import {-# SOURCE #-} TcType( TyVarDetails ) -import {-# SOURCE #-} IdInfo( GlobalIdDetails, notGlobalId, - IdInfo, seqIdInfo ) +import {-# SOURCE #-} TcType( TcTyVarDetails ) +import {-# SOURCE #-} IdInfo( GlobalIdDetails, notGlobalId, IdInfo, seqIdInfo ) import Name ( Name, OccName, NamedThing(..), setNameUnique, setNameOcc, nameUnique @@ -45,7 +44,6 @@ import Kind ( Kind ) import Unique ( Unique, Uniquable(..), mkUniqueGrimily, getKey# ) import FastTypes import Outputable -import DATA_IOREF \end{code} @@ -71,11 +69,10 @@ data Var tyVarKind :: Kind } | TcTyVar { -- Used only during type inference - varName :: !Name, -- Could we get away without a Name? + varName :: !Name, realUnique :: FastInt, tyVarKind :: Kind, - tcTyVarRef :: IORef (Maybe Type), - tcTyVarDetails :: TyVarDetails } + tcTyVarDetails :: TcTyVarDetails } | GlobalId { -- Used for imported Ids, dict selectors etc varName :: !Name, @@ -96,6 +93,8 @@ data LocalIdDetails | Exported -- Exported | SpecPragma -- Not exported, but not to be discarded either -- It's unclean that this is so deeply built in + -- Exported and SpecPragma Ids are kept alive; + -- NotExported things may be discarded as dead code. \end{code} LocalId and GlobalId @@ -180,12 +179,11 @@ mkTyVar name kind = TyVar { varName = name , tyVarKind = kind } -mkTcTyVar :: Name -> Kind -> TyVarDetails -> IORef (Maybe Type) -> TyVar -mkTcTyVar name kind details ref +mkTcTyVar :: Name -> Kind -> TcTyVarDetails -> TyVar +mkTcTyVar name kind details = TcTyVar { varName = name, realUnique = getKey# (nameUnique name), tyVarKind = kind, - tcTyVarRef = ref, tcTyVarDetails = details } \end{code}