[project @ 2000-07-11 16:12:11 by simonmar]
[ghc-hetmet.git] / ghc / compiler / basicTypes / Module.lhs
index cbec03c..92877df 100644 (file)
@@ -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