Commit e802f7a7 authored by simonpj's avatar simonpj
Browse files

[project @ 2004-01-05 10:41:04 by simonpj]

Fix globaliseId wibble which was killing ghci
parent e328afb3
......@@ -19,7 +19,7 @@ module Id (
recordSelectorFieldLabel,
-- Modifying an Id
setIdName, setIdUnique, Id.setIdType, setIdLocalExported, setGlobalIdDetails,
setIdName, setIdUnique, Id.setIdType, setIdLocalExported,
setIdInfo, lazySetIdInfo, modifyIdInfo, maybeModifyIdInfo,
zapLamIdInfo, zapDemandIdInfo,
......@@ -86,7 +86,7 @@ import Var ( Id, DictId,
setIdName, setIdType, setIdUnique, setIdLocalExported,
setIdInfo, lazySetIdInfo, modifyIdInfo,
maybeModifyIdInfo,
globalIdDetails, setGlobalIdDetails
globalIdDetails
)
import qualified Var ( mkLocalId, mkGlobalId, mkSpecPragmaId, mkExportedLocalId )
import Type ( Type, typePrimRep, addFreeTyVars, seqType)
......
......@@ -21,7 +21,7 @@ module Var (
setIdName, setIdUnique, setIdType, setIdInfo, lazySetIdInfo,
setIdLocalExported, zapSpecPragmaId,
globalIdDetails, setGlobalIdDetails,
globalIdDetails, globaliseId,
mkLocalId, mkExportedLocalId, mkSpecPragmaId,
mkGlobalId,
......@@ -221,9 +221,13 @@ setIdLocalExported :: Id -> Id
-- It had better be a LocalId already
setIdLocalExported id = id { lclDetails = Exported }
setGlobalIdDetails :: Id -> GlobalIdDetails -> Id
-- It had better be a GlobalId already
setGlobalIdDetails id details = id { gblDetails = details }
globaliseId :: GlobalIdDetails -> Id -> Id
-- If it's a local, make it global
globaliseId details id = GlobalId { varName = varName id,
realUnique = realUnique id,
idType = idType id,
idInfo = idInfo id,
gblDetails = details }
zapSpecPragmaId :: Id -> Id
zapSpecPragmaId id
......
......@@ -95,7 +95,7 @@ import MkId ( unsafeCoerceId )
import TysWiredIn ( mkListTy, unitTy )
import IdInfo ( GlobalIdDetails(..) )
import SrcLoc ( interactiveSrcLoc, unLoc )
import Var ( setGlobalIdDetails )
import Var ( globaliseId )
import Name ( nameOccName, nameModuleName )
import NameEnv ( delListFromNameEnv )
import PrelNames ( iNTERACTIVE, ioTyConName, printName, monadNames, itName, returnIOName )
......@@ -244,8 +244,7 @@ tcRnStmt hsc_env ictxt rdr_stmt
-- important: otherwise when we come to compile an expression
-- using these ids later, the byte code generator will consider
-- the occurrences to be free rather than global.
global_ids = map globaliseId bound_ids ;
globaliseId id = setGlobalIdDetails id VanillaGlobal ;
global_ids = map (globaliseId VanillaGlobal) bound_ids ;
-- Update the interactive context
rn_env = ic_rn_local_env ictxt ;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment