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 ( ...@@ -19,7 +19,7 @@ module Id (
recordSelectorFieldLabel, recordSelectorFieldLabel,
-- Modifying an Id -- Modifying an Id
setIdName, setIdUnique, Id.setIdType, setIdLocalExported, setGlobalIdDetails, setIdName, setIdUnique, Id.setIdType, setIdLocalExported,
setIdInfo, lazySetIdInfo, modifyIdInfo, maybeModifyIdInfo, setIdInfo, lazySetIdInfo, modifyIdInfo, maybeModifyIdInfo,
zapLamIdInfo, zapDemandIdInfo, zapLamIdInfo, zapDemandIdInfo,
...@@ -86,7 +86,7 @@ import Var ( Id, DictId, ...@@ -86,7 +86,7 @@ import Var ( Id, DictId,
setIdName, setIdType, setIdUnique, setIdLocalExported, setIdName, setIdType, setIdUnique, setIdLocalExported,
setIdInfo, lazySetIdInfo, modifyIdInfo, setIdInfo, lazySetIdInfo, modifyIdInfo,
maybeModifyIdInfo, maybeModifyIdInfo,
globalIdDetails, setGlobalIdDetails globalIdDetails
) )
import qualified Var ( mkLocalId, mkGlobalId, mkSpecPragmaId, mkExportedLocalId ) import qualified Var ( mkLocalId, mkGlobalId, mkSpecPragmaId, mkExportedLocalId )
import Type ( Type, typePrimRep, addFreeTyVars, seqType) import Type ( Type, typePrimRep, addFreeTyVars, seqType)
......
...@@ -21,7 +21,7 @@ module Var ( ...@@ -21,7 +21,7 @@ module Var (
setIdName, setIdUnique, setIdType, setIdInfo, lazySetIdInfo, setIdName, setIdUnique, setIdType, setIdInfo, lazySetIdInfo,
setIdLocalExported, zapSpecPragmaId, setIdLocalExported, zapSpecPragmaId,
globalIdDetails, setGlobalIdDetails, globalIdDetails, globaliseId,
mkLocalId, mkExportedLocalId, mkSpecPragmaId, mkLocalId, mkExportedLocalId, mkSpecPragmaId,
mkGlobalId, mkGlobalId,
...@@ -221,9 +221,13 @@ setIdLocalExported :: Id -> Id ...@@ -221,9 +221,13 @@ setIdLocalExported :: Id -> Id
-- It had better be a LocalId already -- It had better be a LocalId already
setIdLocalExported id = id { lclDetails = Exported } setIdLocalExported id = id { lclDetails = Exported }
setGlobalIdDetails :: Id -> GlobalIdDetails -> Id globaliseId :: GlobalIdDetails -> Id -> Id
-- It had better be a GlobalId already -- If it's a local, make it global
setGlobalIdDetails id details = id { gblDetails = details } globaliseId details id = GlobalId { varName = varName id,
realUnique = realUnique id,
idType = idType id,
idInfo = idInfo id,
gblDetails = details }
zapSpecPragmaId :: Id -> Id zapSpecPragmaId :: Id -> Id
zapSpecPragmaId id zapSpecPragmaId id
......
...@@ -95,7 +95,7 @@ import MkId ( unsafeCoerceId ) ...@@ -95,7 +95,7 @@ import MkId ( unsafeCoerceId )
import TysWiredIn ( mkListTy, unitTy ) import TysWiredIn ( mkListTy, unitTy )
import IdInfo ( GlobalIdDetails(..) ) import IdInfo ( GlobalIdDetails(..) )
import SrcLoc ( interactiveSrcLoc, unLoc ) import SrcLoc ( interactiveSrcLoc, unLoc )
import Var ( setGlobalIdDetails ) import Var ( globaliseId )
import Name ( nameOccName, nameModuleName ) import Name ( nameOccName, nameModuleName )
import NameEnv ( delListFromNameEnv ) import NameEnv ( delListFromNameEnv )
import PrelNames ( iNTERACTIVE, ioTyConName, printName, monadNames, itName, returnIOName ) import PrelNames ( iNTERACTIVE, ioTyConName, printName, monadNames, itName, returnIOName )
...@@ -244,8 +244,7 @@ tcRnStmt hsc_env ictxt rdr_stmt ...@@ -244,8 +244,7 @@ tcRnStmt hsc_env ictxt rdr_stmt
-- important: otherwise when we come to compile an expression -- important: otherwise when we come to compile an expression
-- using these ids later, the byte code generator will consider -- using these ids later, the byte code generator will consider
-- the occurrences to be free rather than global. -- the occurrences to be free rather than global.
global_ids = map globaliseId bound_ids ; global_ids = map (globaliseId VanillaGlobal) bound_ids ;
globaliseId id = setGlobalIdDetails id VanillaGlobal ;
-- Update the interactive context -- Update the interactive context
rn_env = ic_rn_local_env ictxt ; 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