[project @ 1999-09-16 17:11:38 by sof]
authorsof <unknown>
Thu, 16 Sep 1999 17:11:38 +0000 (17:11 +0000)
committersof <unknown>
Thu, 16 Sep 1999 17:11:38 +0000 (17:11 +0000)
mkVanillaModule: sigh, special treatment for module Main.

ghc/compiler/basicTypes/Module.lhs

index ead105a..38a3609 100644 (file)
@@ -194,8 +194,14 @@ mkModule = Module
 mkVanillaModule :: ModuleName -> Module
 mkVanillaModule name = Module name UserMod dell
  where
-  dell | opt_Static || opt_CompilingPrelude = NotDll
-       | otherwise                         = Dll
+  main_mod = mkSrcModuleFS SLIT("Main")
+
+   -- Main can never be in a DLL - need this
+   -- special case in order to correctly
+   -- compile PrelMain
+  dell | opt_Static || opt_CompilingPrelude || 
+         name == main_mod = NotDll
+       | otherwise       = Dll
 
 
 mkThisModule :: ModuleName -> Module   -- The module being comiled