X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FdeSugar%2FDesugar.lhs;h=603c8584c0295e917d4f2b3ec09907d812c09bc1;hp=cbf64e220fbf1b47a53cd453501094ce6610a2da;hb=6cec61d14a324285dbb8ce73d4c7215f1f8d6766;hpb=aee44bbe090c356d649398a93e260d967a7c50db diff --git a/compiler/deSugar/Desugar.lhs b/compiler/deSugar/Desugar.lhs index cbf64e2..603c858 100644 --- a/compiler/deSugar/Desugar.lhs +++ b/compiler/deSugar/Desugar.lhs @@ -41,6 +41,8 @@ import MonadUtils import OrdList import Data.List import Data.IORef +import PrelNames +import UniqSupply \end{code} %************************************************************************ @@ -90,7 +92,7 @@ deSugar hsc_env <- case target of HscNothing -> return (emptyMessages, - Just ([], nilOL, [], [], NoStubs, hpcInfo, emptyModBreaks)) + Just ([], nilOL, [], [], NoStubs, hpcInfo, emptyModBreaks, undefined, undefined)) _ -> do (binds_cvr,ds_hpc_info, modBreaks) <- if (opt_Hpc @@ -106,14 +108,20 @@ deSugar hsc_env ; (ds_fords, foreign_prs) <- dsForeigns fords ; ds_rules <- mapMaybeM dsRule rules ; ds_vects <- mapM dsVect vects + ; hetmet_brak <- if dopt Opt_F_coqpass dflags then dsLookupGlobalId hetmet_brak_name else return undefined + ; hetmet_esc <- if dopt Opt_F_coqpass dflags then dsLookupGlobalId hetmet_esc_name else return undefined + ; let hpc_init + | opt_Hpc = hpcInitCode mod ds_hpc_info + | otherwise = empty ; return ( ds_ev_binds , foreign_prs `appOL` core_prs `appOL` spec_prs , spec_rules ++ ds_rules, ds_vects - , ds_fords, ds_hpc_info, modBreaks) } + , ds_fords `appendStubC` hpc_init + , ds_hpc_info, modBreaks, hetmet_brak, hetmet_esc) } ; case mb_res of { Nothing -> return (msgs, Nothing) ; - Just (ds_ev_binds, all_prs, all_rules, ds_vects, ds_fords,ds_hpc_info, modBreaks) -> do + Just (ds_ev_binds, all_prs, all_rules, ds_vects, ds_fords,ds_hpc_info, modBreaks, hetmet_brak, hetmet_esc) -> do { -- Add export flags to bindings keep_alive <- readIORef keep_var @@ -141,7 +149,9 @@ deSugar hsc_env ; dumpIfSet_dyn dflags Opt_D_coqpass "Coq Pass Output" $ text $ coqPassCoreToString ds_binds ; ds_binds' <- if dopt Opt_F_coqpass dflags - then return $ coqPassCoreToCore ds_binds + then do { us <- mkSplitUniqSupply '~' + ; return $ coqPassCoreToCore hetmet_brak hetmet_esc us ds_binds + } else return ds_binds ; dumpIfSet_dyn dflags Opt_D_dump_coqpass "After Coq Pass" (text $ showSDoc $ pprCoreBindings ds_binds') @@ -168,7 +178,7 @@ deSugar hsc_env mg_inst_env = inst_env, mg_fam_inst_env = fam_inst_env, mg_rules = ds_rules_for_imps, - mg_binds = ds_binds, + mg_binds = ds_binds', mg_foreign = ds_fords, mg_hpc_info = ds_hpc_info, mg_modBreaks = modBreaks,