X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FbasicTypes%2FModule.lhs;h=92877df6e8c1543f944c5349da2674a2013ae2d2;hb=1b7a99e3e7f64c6f402e8aece32ba0b9a3703bfa;hp=cbec03c8d197deb226ff4d0771c649c787456a0e;hpb=cf58efc14e5c4b3a83f221a2e6347f99c73cfc57;p=ghc-hetmet.git diff --git a/ghc/compiler/basicTypes/Module.lhs b/ghc/compiler/basicTypes/Module.lhs index cbec03c..92877df 100644 --- a/ghc/compiler/basicTypes/Module.lhs +++ b/ghc/compiler/basicTypes/Module.lhs @@ -5,6 +5,19 @@ Representing modules and their flavours. + +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 ( @@ -93,27 +106,6 @@ instance Show PackageInfo where -- Just used in debug prints of lex tokens %************************************************************************ %* * -\subsection{System/user module} -%* * -%************************************************************************ - -We also track whether an imported module is from a 'system-ish' place. In this case -we don't record the fact that this module depends on it, nor usages of things -inside it. - -Apr 00: We want to record dependencies on all modules other than -prelude modules else STG Hugs gets confused because it uses this -info to know what modules to link. (Compiled GHC uses command line -options to specify this.) - -\begin{code} -data ModFlavour = PrelMod -- A Prelude module - | UserMod -- Not library-ish -\end{code} - - -%************************************************************************ -%* * \subsection{Where from} %* * %************************************************************************ @@ -183,9 +175,7 @@ instance Ord Module where \begin{code} pprModule :: Module -> SDoc pprModule (Module mod p) = getPprStyle $ \ sty -> - if userStyle sty then - text (moduleNameUserString mod) - else if debugStyle sty then + if debugStyle sty then -- Print the package too text (show p) <> dot <> pprModuleName mod else @@ -203,6 +193,7 @@ mkModule mod_nm pack_name pack_info | pack_name == opt_InPackage = ThisPackage | otherwise = AnotherPackage pack_name + mkVanillaModule :: ModuleName -> Module mkVanillaModule name = Module name ThisPackage -- Used temporarily when we first come across Foo.x in an interface