From e7eb4e16c90e7c0f17637d036879439873bec18d Mon Sep 17 00:00:00 2001 From: Roman Leshchinskiy Date: Tue, 17 Jul 2007 06:42:33 +0000 Subject: [PATCH] Initialise global vectorisation environment properly --- compiler/vectorise/VectMonad.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/compiler/vectorise/VectMonad.hs b/compiler/vectorise/VectMonad.hs index 157bea3..f6f8139 100644 --- a/compiler/vectorise/VectMonad.hs +++ b/compiler/vectorise/VectMonad.hs @@ -143,12 +143,14 @@ data LocalEnv = LocalEnv { } -initGlobalEnv :: VectInfo -> (InstEnv, InstEnv) -> FamInstEnvs -> GlobalEnv -initGlobalEnv info instEnvs famInstEnvs +initGlobalEnv :: VectInfo -> (InstEnv, InstEnv) -> FamInstEnvs -> Builtins -> GlobalEnv +initGlobalEnv info instEnvs famInstEnvs bi = GlobalEnv { global_vars = mapVarEnv (Var . snd) $ vectInfoVar info , global_exported_vars = emptyVarEnv - , global_tycons = mapNameEnv snd $ vectInfoTyCon info + , global_tycons = extendNameEnv (mapNameEnv snd (vectInfoTyCon info)) + (tyConName funTyCon) (closureTyCon bi) + , global_datacons = mapNameEnv snd $ vectInfoDataCon info , global_inst_env = instEnvs , global_fam_inst_env = famInstEnvs @@ -396,7 +398,7 @@ initV hsc_env guts info p go instEnvs famInstEnvs = do builtins <- initBuiltins - r <- runVM p builtins (initGlobalEnv info instEnvs famInstEnvs) + r <- runVM p builtins (initGlobalEnv info instEnvs famInstEnvs builtins) emptyLocalEnv case r of Yes genv _ x -> return $ Just (new_info genv, x) -- 1.7.10.4