summaryrefslogtreecommitdiff
path: root/ghc/compiler/codeGen/CodeGen.lhs
diff options
context:
space:
mode:
authorsimonmar <unknown>2004-03-11 09:53:45 +0000
committersimonmar <unknown>2004-03-11 09:53:45 +0000
commit4fc797aa4c775daf73c728ce9b3863a6a4ab53c2 (patch)
treededeaf5ad02d9f144bef2beb5d7925280d5cde27 /ghc/compiler/codeGen/CodeGen.lhs
parent1ee6cec9e8c6f97033d4a44ccda3de599c731b62 (diff)
downloadhaskell-4fc797aa4c775daf73c728ce9b3863a6a4ab53c2.tar.gz
[project @ 2004-03-11 09:53:45 by simonmar]
Add dependency on GHC.TopHandler if this is the main module.
Diffstat (limited to 'ghc/compiler/codeGen/CodeGen.lhs')
-rw-r--r--ghc/compiler/codeGen/CodeGen.lhs9
1 files changed, 7 insertions, 2 deletions
diff --git a/ghc/compiler/codeGen/CodeGen.lhs b/ghc/compiler/codeGen/CodeGen.lhs
index 4ac0eaa557..1c817aef51 100644
--- a/ghc/compiler/codeGen/CodeGen.lhs
+++ b/ghc/compiler/codeGen/CodeGen.lhs
@@ -28,7 +28,7 @@ import DriverState ( v_Build_tag, v_MainModIs )
import StgSyn
import CgMonad
import AbsCSyn
-import PrelNames ( gHC_PRIM, rOOT_MAIN, mAIN_Name )
+import PrelNames ( gHC_PRIM, rOOT_MAIN, mAIN_Name, pREL_TOP_HANDLER )
import CLabel ( mkSRTLabel, mkClosureLabel,
mkPlainModuleInitLabel, mkModuleInitLabel )
import PprAbsC ( dumpRealC )
@@ -145,7 +145,12 @@ mkModuleInit way cost_centre_info this_mod mb_main_mod foreign_stubs imported_mo
CLbl (mkModuleInitLabel mod way) AddrRep
]
- register_mod_imports = map mk_import_register imported_mods
+ extra_imported_mods
+ | Module.moduleName this_mod == main_mod_name = [ pREL_TOP_HANDLER ]
+ | otherwise = [ ]
+
+ register_mod_imports =
+ map mk_import_register (imported_mods ++ extra_imported_mods)
-- When compiling the module in which the 'main' function lives,
-- we inject an extra stg_init procedure for stg_init_ZCMain, for the