Commit ef5b4b14 authored by simonmar's avatar simonmar

[project @ 2004-11-26 16:19:45 by simonmar]

Further integration with the new package story.  GHC now supports
pretty much everything in the package proposal.

  - GHC now works in terms of PackageIds (<pkg>-<version>) rather than
    just package names.  You can still specify package names without
    versions on the command line, as long as the name is unambiguous.

  - GHC understands hidden/exposed modules in a package, and will refuse
    to import a hidden module.  Also, the hidden/eposed status of packages
    is taken into account.

  - I had to remove the old package syntax from ghc-pkg, backwards
    compatibility isn't really practical.

  - All the package.conf.in files have been rewritten in the new syntax,
    and contain a complete list of modules in the package.  I've set all
    the versions to 1.0 for now - please check your package(s) and fix the
    version number & other info appropriately.

  - New options:

	-hide-package P    sets the expose flag on package P to False
	-ignore-package P  unregisters P for this compilation

	For comparison, -package P sets the expose flag on package P
        to True, and also causes P to be linked in eagerly.

        -package-name is no longer officially supported.  Unofficially, it's
	a synonym for -ignore-package, which has more or less the same effect
	as -package-name used to.

	Note that a package may be hidden and yet still be linked into
	the program, by virtue of being a dependency of some other package.
	To completely remove a package from the compiler's internal database,
        use -ignore-package.

	The compiler will complain if any two packages in the
        transitive closure of exposed packages contain the same
        module.

	You *must* use -ignore-package P when compiling modules for
        package P, if package P (or an older version of P) is already
        registered.  The compiler will helpfully complain if you don't.
	The fptools build system does this.

   - Note: the Cabal library won't work yet.  It still thinks GHC uses
     the old package config syntax.

Internal changes/cleanups:

   - The ModuleName type has gone away.  Modules are now just (a
     newtype of) FastStrings, and don't contain any package information.
     All the package-related knowledge is in DynFlags, which is passed
     down to where it is needed.

   - DynFlags manipulation has been cleaned up somewhat: there are no
     global variables holding DynFlags any more, instead the DynFlags
     are passed around properly.

   - There are a few less global variables in GHC.  Lots more are
     scheduled for removal.

   - -i is now a dynamic flag, as are all the package-related flags (but
     using them in {-# OPTIONS #-} is Officially Not Recommended).

   - make -j now appears to work under fptools/libraries/.  Probably
     wouldn't take much to get it working for a whole build.
parent 1f8b341a
......@@ -522,6 +522,7 @@ endif
# from mkDependHS.
SRC_MKDEPENDHS_OPTS += \
-optdep--exclude-module=Compat.RawSystem \
-optdep--exclude-module=Compat.Directory \
-optdep--exclude-module=Data.Version \
-optdep--exclude-module=Distribution.Package \
-optdep--exclude-module=Distribution.InstalledPackageInfo \
......
__interface Module 1 0 where
__export Module ModuleName ;
1 data ModuleName ;
__export Module Module ;
1 data Module ;
module Module where
data ModuleName
data Module
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-2002
% (c) The University of Glasgow, 2004
%
ModuleName
Module
~~~~~~~~~~
Simply the name of a module, represented as a Z-encoded FastString.
These are Uniquable, hence we can build FiniteMaps with ModuleNames as
the keys.
Module
~~~~~~
A ModuleName with some additional information, namely whether the
module resides in the Home package or in a different package. We need
to know this for two reasons:
* generating cross-DLL calls is different from intra-DLL calls
(see below).
* we don't record version information in interface files for entities
in a different package.
The unique of a Module is identical to the unique of a ModuleName, so
it is safe to look up in a Module map using a ModuleName and vice
versa.
Notes on DLLs
~~~~~~~~~~~~~
When compiling module A, which imports module B, we need to
know whether B will be in the same DLL as A.
If it's in the same DLL, we refer to B_f_closure
If it isn't, we refer to _imp__B_f_closure
When compiling A, we record in B's Module value whether it's
in a different DLL, by setting the DLL flag.
\begin{code}
module Module
(
Module, -- Abstract, instance of Eq, Ord, Outputable
, pprModule -- :: ModuleName -> SDoc
, ModLocation(..),
, showModMsg
, ModuleName
, pprModuleName -- :: ModuleName -> SDoc
, printModulePrefix
, moduleString -- :: ModuleName -> EncodedString
, moduleUserString -- :: ModuleName -> UserString
, moduleFS -- :: ModuleName -> EncodedFS
, moduleName -- :: Module -> ModuleName
, moduleNameString -- :: ModuleName -> EncodedString
, moduleNameUserString -- :: ModuleName -> UserString
, moduleNameFS -- :: ModuleName -> EncodedFS
, moduleString -- :: Module -> EncodedString
, moduleUserString -- :: Module -> UserString
, mkModule
, mkBasePkgModule -- :: UserString -> Module
, mkHomeModule -- :: ModuleName -> Module
, isHomeModule -- :: Module -> Bool
, mkPackageModule -- :: ModuleName -> Module
, mkModuleName -- :: UserString -> ModuleName
, mkModuleNameFS -- :: UserFS -> ModuleName
, mkSysModuleNameFS -- :: EncodedFS -> ModuleName
, pprModule,
, mkModule -- :: UserString -> ModuleName
, mkModuleFS -- :: UserFS -> ModuleName
, mkSysModuleFS -- :: EncodedFS -> ModuleName
, ModuleEnv,
, elemModuleEnv, extendModuleEnv, extendModuleEnvList, plusModuleEnv_C
......@@ -74,7 +31,6 @@ module Module
, lookupWithDefaultModuleEnv, mapModuleEnv, mkModuleEnv, emptyModuleEnv
, moduleEnvElts, unitModuleEnv, isEmptyModuleEnv, foldModuleEnv
, extendModuleEnv_C
, lookupModuleEnvByName, extendModuleEnvByName, unitModuleEnvByName
, ModuleSet, emptyModuleSet, mkModuleSet, moduleSetElts, extendModuleSet, elemModuleSet
......@@ -83,8 +39,6 @@ module Module
#include "HsVersions.h"
import OccName
import Outputable
import Packages ( PackageName, basePackage )
import CmdLineOpts ( opt_InPackage )
import Unique ( Uniquable(..) )
import Maybes ( expectJust )
import UniqFM
......@@ -93,44 +47,6 @@ import Binary
import FastString
\end{code}
%************************************************************************
%* *
\subsection{Interface file flavour}
%* *
%************************************************************************
A further twist to the tale is the support for dynamically linked
libraries under Win32. Here, dealing with the use of global variables
that's residing in a DLL requires special handling at the point of use
(there's an extra level of indirection, i.e., (**v) to get at v's
value, rather than just (*v) .) When slurping in an interface file we
then record whether it's coming from a .hi corresponding to a module
that's packaged up in a DLL or not, so that we later can emit the
appropriate code.
The logic for how an interface file is marked as corresponding to a
module that's hiding in a DLL is explained elsewhere (ToDo: give
renamer href here.)
\begin{code}
data Module = Module ModuleName !PackageInfo
data PackageInfo
= ThisPackage -- A module from the same package
-- as the one being compiled
| AnotherPackage -- A module from a different package
packageInfoPackage :: PackageInfo -> PackageName
packageInfoPackage ThisPackage = opt_InPackage
packageInfoPackage AnotherPackage = FSLIT("<pkg>")
instance Outputable PackageInfo where
-- Just used in debug prints of lex tokens and in debug modde
ppr pkg_info = ppr (packageInfoPackage pkg_info)
\end{code}
%************************************************************************
%* *
\subsection{Module locations}
......@@ -187,124 +103,54 @@ where the object file will reside if/when it is created.
%************************************************************************
\begin{code}
newtype ModuleName = ModuleName EncodedFS
newtype Module = Module EncodedFS
-- Haskell module names can include the quote character ',
-- so the module names have the z-encoding applied to them
instance Binary ModuleName where
put_ bh (ModuleName m) = put_ bh m
get bh = do m <- get bh; return (ModuleName m)
instance Binary Module where
put_ bh (Module m) = put_ bh m
get bh = do m <- get bh; return (Module m)
instance Uniquable ModuleName where
getUnique (ModuleName nm) = getUnique nm
instance Uniquable Module where
getUnique (Module nm) = getUnique nm
instance Eq ModuleName where
instance Eq Module where
nm1 == nm2 = getUnique nm1 == getUnique nm2
-- Warning: gives an ordering relation based on the uniques of the
-- FastStrings which are the (encoded) module names. This is _not_
-- a lexicographical ordering.
instance Ord ModuleName where
instance Ord Module where
nm1 `compare` nm2 = getUnique nm1 `compare` getUnique nm2
instance Outputable ModuleName where
ppr = pprModuleName
pprModuleName :: ModuleName -> SDoc
pprModuleName (ModuleName nm) = pprEncodedFS nm
moduleNameFS :: ModuleName -> EncodedFS
moduleNameFS (ModuleName mod) = mod
moduleNameString :: ModuleName -> EncodedString
moduleNameString (ModuleName mod) = unpackFS mod
moduleNameUserString :: ModuleName -> UserString
moduleNameUserString (ModuleName mod) = decode (unpackFS mod)
-- used to be called mkSrcModule
mkModuleName :: UserString -> ModuleName
mkModuleName s = ModuleName (mkFastString (encode s))
-- used to be called mkSrcModuleFS
mkModuleNameFS :: UserFS -> ModuleName
mkModuleNameFS s = ModuleName (encodeFS s)
-- used to be called mkSysModuleFS
mkSysModuleNameFS :: EncodedFS -> ModuleName
mkSysModuleNameFS s = ModuleName s
\end{code}
\begin{code}
instance Outputable Module where
ppr = pprModule
instance Uniquable Module where
getUnique (Module nm _) = getUnique nm
-- Same if they have the same name.
instance Eq Module where
m1 == m2 = getUnique m1 == getUnique m2
-- Warning: gives an ordering relation based on the uniques of the
-- FastStrings which are the (encoded) module names. This is _not_
-- a lexicographical ordering.
instance Ord Module where
m1 `compare` m2 = getUnique m1 `compare` getUnique m2
\end{code}
\begin{code}
pprModule :: Module -> SDoc
pprModule (Module mod p) = getPprStyle $ \ sty ->
if debugStyle sty then
-- Print the package too
-- Don't use '.' because it gets confused
-- with module names
brackets (ppr p) <> pprModuleName mod
else
pprModuleName mod
\end{code}
\begin{code}
mkModule :: PackageName -> ModuleName -> Module
mkModule pkg_name mod_name
= Module mod_name pkg_info
where
pkg_info
| opt_InPackage == pkg_name = ThisPackage
| otherwise = AnotherPackage
mkBasePkgModule :: ModuleName -> Module
mkBasePkgModule mod_nm = mkModule basePackage mod_nm
mkHomeModule :: ModuleName -> Module
mkHomeModule mod_nm = Module mod_nm ThisPackage
isHomeModule :: Module -> Bool
isHomeModule (Module nm ThisPackage) = True
isHomeModule _ = False
pprModule (Module nm) = pprEncodedFS nm
mkPackageModule :: ModuleName -> Module
mkPackageModule mod_nm = Module mod_nm AnotherPackage
moduleFS :: Module -> EncodedFS
moduleFS (Module mod) = mod
moduleString :: Module -> EncodedString
moduleString (Module (ModuleName fs) _) = unpackFS fs
moduleName :: Module -> ModuleName
moduleName (Module mod pkg_info) = mod
moduleString (Module mod) = unpackFS mod
moduleUserString :: Module -> UserString
moduleUserString (Module mod _) = moduleNameUserString mod
moduleUserString (Module mod) = decode (unpackFS mod)
printModulePrefix :: Module -> Bool
-- When printing, say M.x
printModulePrefix (Module nm ThisPackage) = False
printModulePrefix _ = True
\end{code}
-- used to be called mkSrcModule
mkModule :: UserString -> Module
mkModule s = Module (mkFastString (encode s))
-- used to be called mkSrcModuleFS
mkModuleFS :: UserFS -> Module
mkModuleFS s = Module (encodeFS s)
-- used to be called mkSysModuleFS
mkSysModuleFS :: EncodedFS -> Module
mkSysModuleFS s = Module s
\end{code}
%************************************************************************
%* *
......@@ -314,9 +160,6 @@ printModulePrefix _ = True
\begin{code}
type ModuleEnv elt = UniqFM elt
-- A ModuleName and Module have the same Unique,
-- so both will work as keys.
-- The 'ByName' variants work on ModuleNames
emptyModuleEnv :: ModuleEnv a
mkModuleEnv :: [(Module, a)] -> ModuleEnv a
......@@ -338,14 +181,8 @@ lookupWithDefaultModuleEnv :: ModuleEnv a -> a -> Module -> a
elemModuleEnv :: Module -> ModuleEnv a -> Bool
foldModuleEnv :: (a -> b -> b) -> b -> ModuleEnv a -> b
-- The ByName variants
lookupModuleEnvByName :: ModuleEnv a -> ModuleName -> Maybe a
unitModuleEnvByName :: ModuleName -> a -> ModuleEnv a
extendModuleEnvByName :: ModuleEnv a -> ModuleName -> a -> ModuleEnv a
elemModuleEnv = elemUFM
extendModuleEnv = addToUFM
extendModuleEnvByName = addToUFM
extendModuleEnv_C = addToUFM_C
extendModuleEnvList = addListToUFM
plusModuleEnv_C = plusUFM_C
......@@ -353,20 +190,17 @@ delModuleEnvList = delListFromUFM
delModuleEnv = delFromUFM
plusModuleEnv = plusUFM
lookupModuleEnv = lookupUFM
lookupModuleEnvByName = lookupUFM
lookupWithDefaultModuleEnv = lookupWithDefaultUFM
mapModuleEnv = mapUFM
mkModuleEnv = listToUFM
emptyModuleEnv = emptyUFM
moduleEnvElts = eltsUFM
unitModuleEnv = unitUFM
unitModuleEnvByName = unitUFM
isEmptyModuleEnv = isNullUFM
foldModuleEnv = foldUFM
\end{code}
\begin{code}
type ModuleSet = UniqSet Module
mkModuleSet :: [Module] -> ModuleSet
extendModuleSet :: ModuleSet -> Module -> ModuleSet
......
......@@ -17,16 +17,16 @@ module Name (
mkExternalName, mkWiredInName,
nameUnique, setNameUnique,
nameOccName, nameModule, nameModule_maybe, nameModuleName,
nameOccName, nameModule, nameModule_maybe,
setNameOcc,
hashName, localiseName,
nameSrcLoc, nameParent, nameParent_maybe,
isSystemName, isInternalName, isExternalName,
isTyVarName, isDllName, isWiredInName, isBuiltInSyntax,
isTyVarName, isWiredInName, isBuiltInSyntax,
wiredInNameTyThing_maybe,
nameIsLocalOrFrom, isHomePackageName,
nameIsLocalOrFrom,
-- Class NamedThing and overloaded friends
NamedThing(..),
......@@ -38,8 +38,7 @@ module Name (
import {-# SOURCE #-} TypeRep( TyThing )
import OccName -- All of it
import Module ( Module, ModuleName, moduleName, isHomeModule )
import CmdLineOpts ( opt_Static )
import Module ( Module )
import SrcLoc ( noSrcLoc, wiredInSrcLoc, SrcLoc )
import Unique ( Unique, Uniquable(..), getKey, pprUnique )
import Maybes ( orElse )
......@@ -120,7 +119,6 @@ All built-in syntax is for wired-in things.
nameUnique :: Name -> Unique
nameOccName :: Name -> OccName
nameModule :: Name -> Module
nameModuleName :: Name -> ModuleName
nameSrcLoc :: Name -> SrcLoc
nameUnique name = n_uniq name
......@@ -133,7 +131,6 @@ nameIsLocalOrFrom :: Module -> Name -> Bool
isInternalName :: Name -> Bool
isExternalName :: Name -> Bool
isSystemName :: Name -> Bool
isHomePackageName :: Name -> Bool
isWiredInName :: Name -> Bool
isWiredInName (Name {n_sort = WiredIn _ _ _ _}) = True
......@@ -163,8 +160,6 @@ nameParent name = case nameParent_maybe name of
Nothing -> name
nameModule name = nameModule_maybe name `orElse` pprPanic "nameModule" (ppr name)
nameModuleName name = moduleName (nameModule name)
nameModule_maybe (Name { n_sort = External mod _}) = Just mod
nameModule_maybe (Name { n_sort = WiredIn mod _ _ _}) = Just mod
nameModule_maybe name = Nothing
......@@ -173,13 +168,6 @@ nameIsLocalOrFrom from name
| isExternalName name = from == nameModule name
| otherwise = True
isHomePackageName name
| isExternalName name = isHomeModule (nameModule name)
| otherwise = True -- Internal and system names
isDllName :: Name -> Bool -- Does this name refer to something in a different DLL?
isDllName nm = not opt_Static && not (isHomePackageName nm)
isTyVarName :: Name -> Bool
isTyVarName name = isTvOcc (nameOccName name)
......@@ -326,20 +314,18 @@ pprName (Name {n_sort = sort, n_uniq = uniq, n_occ = occ})
Internal -> pprInternal sty uniq occ
pprExternal sty uniq mod occ is_wired is_builtin
| codeStyle sty = ppr mod_name <> char '_' <> ppr_occ_name occ
| codeStyle sty = ppr mod <> char '_' <> ppr_occ_name occ
-- In code style, always qualify
-- ToDo: maybe we could print all wired-in things unqualified
-- in code style, to reduce symbol table bloat?
| debugStyle sty = ppr mod_name <> dot <> ppr_occ_name occ
| debugStyle sty = ppr mod <> dot <> ppr_occ_name occ
<> braces (hsep [if is_wired then ptext SLIT("(w)") else empty,
text (briefOccNameFlavour occ),
pprUnique uniq])
| BuiltInSyntax <- is_builtin = ppr_occ_name occ
-- never qualify builtin syntax
| unqualStyle sty mod_name occ = ppr_occ_name occ
| otherwise = ppr mod_name <> dot <> ppr_occ_name occ
where
mod_name = moduleName mod
| unqualStyle sty mod occ = ppr_occ_name occ
| otherwise = ppr mod <> dot <> ppr_occ_name occ
pprInternal sty uniq occ
| codeStyle sty = pprUnique uniq
......
......@@ -47,8 +47,8 @@ import OccName ( NameSpace, varName,
elemOccEnv, plusOccEnv_C, extendOccEnv_C, foldOccEnv,
occEnvElts
)
import Module ( ModuleName, mkModuleNameFS )
import Name ( Name, NamedThing(getName), nameModuleName, nameParent_maybe,
import Module ( Module, mkModuleFS )
import Name ( Name, NamedThing(getName), nameModule, nameParent_maybe,
nameOccName, isExternalName, nameSrcLoc )
import SrcLoc ( isGoodSrcLoc, SrcSpan )
import Outputable
......@@ -67,13 +67,13 @@ data RdrName
= Unqual OccName
-- Used for ordinary, unqualified occurrences
| Qual ModuleName OccName
| Qual Module OccName
-- A qualified name written by the user in
-- *source* code. The module isn't necessarily
-- the module where the thing is defined;
-- just the one from which it is imported
| Orig ModuleName OccName
| Orig Module OccName
-- An original name; the module is the *defining* module.
-- This is used when GHC generates code that will be fed
-- into the renamer (e.g. from deriving clauses), but where
......@@ -97,10 +97,10 @@ data RdrName
%************************************************************************
\begin{code}
rdrNameModule :: RdrName -> ModuleName
rdrNameModule :: RdrName -> Module
rdrNameModule (Qual m _) = m
rdrNameModule (Orig m _) = m
rdrNameModule (Exact n) = nameModuleName n
rdrNameModule (Exact n) = nameModule n
rdrNameModule (Unqual n) = pprPanic "rdrNameModule" (ppr n)
rdrNameOcc :: RdrName -> OccName
......@@ -121,7 +121,7 @@ setRdrNameSpace :: RdrName -> NameSpace -> RdrName
setRdrNameSpace (Unqual occ) ns = Unqual (setOccNameSpace ns occ)
setRdrNameSpace (Qual m occ) ns = Qual m (setOccNameSpace ns occ)
setRdrNameSpace (Orig m occ) ns = Orig m (setOccNameSpace ns occ)
setRdrNameSpace (Exact n) ns = Orig (nameModuleName n)
setRdrNameSpace (Exact n) ns = Orig (nameModule n)
(setOccNameSpace ns (nameOccName n))
\end{code}
......@@ -130,16 +130,16 @@ setRdrNameSpace (Exact n) ns = Orig (nameModuleName n)
mkRdrUnqual :: OccName -> RdrName
mkRdrUnqual occ = Unqual occ
mkRdrQual :: ModuleName -> OccName -> RdrName
mkRdrQual :: Module -> OccName -> RdrName
mkRdrQual mod occ = Qual mod occ
mkOrig :: ModuleName -> OccName -> RdrName
mkOrig :: Module -> OccName -> RdrName
mkOrig mod occ = Orig mod occ
---------------
mkDerivedRdrName :: Name -> (OccName -> OccName) -> (RdrName)
mkDerivedRdrName parent mk_occ
= mkOrig (nameModuleName parent) (mk_occ (nameOccName parent))
= mkOrig (nameModule parent) (mk_occ (nameOccName parent))
---------------
-- These two are used when parsing source files
......@@ -151,7 +151,7 @@ mkVarUnqual :: UserFS -> RdrName
mkVarUnqual n = Unqual (mkOccFS varName n)
mkQual :: NameSpace -> (UserFS, UserFS) -> RdrName
mkQual sp (m, n) = Qual (mkModuleNameFS m) (mkOccFS sp n)
mkQual sp (m, n) = Qual (mkModuleFS m) (mkOccFS sp n)
getRdrName :: NamedThing thing => thing -> RdrName
getRdrName name = nameRdrName (getName name)
......@@ -164,7 +164,7 @@ nameRdrName name = Exact name
nukeExact :: Name -> RdrName
nukeExact n
| isExternalName n = Orig (nameModuleName n) (nameOccName n)
| isExternalName n = Orig (nameModule n) (nameOccName n)
| otherwise = Unqual (nameOccName n)
\end{code}
......@@ -368,7 +368,7 @@ unQualOK :: GlobalRdrElt -> Bool
unQualOK (GRE {gre_prov = LocalDef _}) = True
unQualOK (GRE {gre_prov = Imported is _}) = not (all is_qual is)
hasQual :: ModuleName -> GlobalRdrElt -> Bool
hasQual :: Module -> GlobalRdrElt -> Bool
-- A qualified version of this thing is in scope
hasQual mod (GRE {gre_prov = LocalDef m}) = m == mod
hasQual mod (GRE {gre_prov = Imported is _}) = any ((== mod) . is_as) is
......@@ -411,7 +411,7 @@ The "provenance" of something says how it came to be in scope.
\begin{code}
data Provenance
= LocalDef -- Defined locally
ModuleName
Module
| Imported -- Imported
[ImportSpec] -- INVARIANT: non-empty
......@@ -429,10 +429,10 @@ data ImportSpec -- Describes a particular import declaration
-- Shared among all the Provenaces for a particular
-- import declaration
= ImportSpec {
is_mod :: ModuleName, -- 'import Muggle'
is_mod :: Module, -- 'import Muggle'
-- Note the Muggle may well not be
-- the defining module for this thing!
is_as :: ModuleName, -- 'as M' (or 'Muggle' if there is no 'as' clause)
is_as :: Module, -- 'as M' (or 'Muggle' if there is no 'as' clause)
is_qual :: Bool, -- True <=> qualified (only)
is_loc :: SrcSpan } -- Location of import statment
......
......@@ -22,6 +22,16 @@ module CLabel (
mkStaticInfoTableLabel,
mkApEntryLabel,
mkApInfoTableLabel,
mkClosureTableLabel,
mkLocalClosureLabel,
mkLocalInfoTableLabel,
mkLocalEntryLabel,
mkLocalConEntryLabel,
mkLocalStaticConEntryLabel,
mkLocalConInfoTableLabel,
mkLocalStaticInfoTableLabel,
mkLocalClosureTableLabel,
mkReturnPtLabel,
mkReturnInfoLabel,
......@@ -30,8 +40,6 @@ module CLabel (
mkBitmapLabel,
mkStringLitLabel,
mkClosureTblLabel,
mkAsmTempLabel,
mkModuleInitLabel,
......@@ -91,11 +99,11 @@ module CLabel (
#include "HsVersions.h"
#include "../includes/ghcconfig.h"
import CmdLineOpts ( opt_Static, opt_DoTickyProfiling )
import CmdLineOpts ( DynFlags, opt_Static, opt_DoTickyProfiling )
import Packages ( isHomeModule )
import DataCon ( ConTag )
import Module ( moduleName, moduleNameFS,
Module, isHomeModule )
import Name ( Name, isDllName, isExternalName )
import Module ( moduleFS, Module )
import Name ( Name, isExternalName, nameModule )
import Unique ( pprUnique, Unique )
import PrimOp ( PrimOp )
import Config ( cLeadingUnderscore )
......@@ -133,6 +141,10 @@ data CLabel
Name -- definition of a particular Id or Con
IdLabelInfo
| DynIdLabel -- like IdLabel, but in a separate package,
Name -- and might therefore need a dynamic
IdLabelInfo -- reference.
| CaseLabel -- A family of labels related to a particular
-- case expression.
{-# UNPACK #-} !Unique -- Unique says which case expression
......@@ -147,13 +159,16 @@ data CLabel
| ModuleInitLabel
Module -- the module name
String -- its "way"
Bool -- True <=> is in a different package
-- at some point we might want some kind of version number in
-- the module init label, to guard against compiling modules in
-- the wrong order. We can't use the interface file version however,
-- because we don't always recompile modules which depend on a module
-- whose version has changed.
| PlainModuleInitLabel Module -- without the vesrion & way info
| PlainModuleInitLabel -- without the vesrion & way info
Module
Bool -- True <=> is in a different package
| ModuleRegdLabel
......@@ -187,7 +202,7 @@ data IdLabelInfo
= Closure -- Label for closure
| SRT -- Static reference table
| SRTDesc -- Static reference table descriptor
| InfoTbl -- Info tables for closures; always read-only
| InfoTable -- Info tables for closures; always read-only
| Entry -- entry point
| Slow -- slow entry point
......@@ -197,9 +212,9 @@ data IdLabelInfo
| Bitmap -- A bitmap (function or case return)