darcs-all: allow relative path for repo in local fs
[ghc-hetmet.git] / compiler / vectorise / VectUtils.hs
index 5b70bf4..199ef68 100644 (file)
@@ -4,7 +4,7 @@ module VectUtils (
   mkPADictType, mkPArrayType,
   paDictArgType, paDictOfType,
   lookupPArrayFamInst,
-  hoistExpr
+  hoistExpr, takeHoisted
 ) where
 
 #include "HsVersions.h"
@@ -115,7 +115,14 @@ hoistExpr :: FastString -> CoreExpr -> VM Var
 hoistExpr fs expr
   = do
       var <- newLocalVar fs (exprType expr)
-      updLEnv $ \env ->
-        env { local_bindings = (var, expr) : local_bindings env }
+      updGEnv $ \env ->
+        env { global_bindings = (var, expr) : global_bindings env }
       return var
 
+takeHoisted :: VM [(Var, CoreExpr)]
+takeHoisted
+  = do
+      env <- readGEnv id
+      setGEnv $ env { global_bindings = [] }
+      return $ global_bindings env
+