From 40138586cd155916f446d8303803b8c8910ce2b2 Mon Sep 17 00:00:00 2001 From: Roman Leshchinskiy Date: Thu, 26 Jul 2007 02:41:44 +0000 Subject: Create exported names in vectorisation monads --- compiler/vectorise/VectMonad.hs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/compiler/vectorise/VectMonad.hs b/compiler/vectorise/VectMonad.hs index ed18f1f7a9..944f8c8b3c 100644 --- a/compiler/vectorise/VectMonad.hs +++ b/compiler/vectorise/VectMonad.hs @@ -3,7 +3,7 @@ module VectMonad ( VM, noV, tryV, maybeV, orElseV, fixV, localV, closedV, initV, - cloneName, newLocalVar, newTyVar, + cloneName, newExportedVar, newLocalVar, newTyVar, Builtins(..), paDictTyCon, paDictDataCon, builtin, @@ -47,6 +47,7 @@ import FamInstEnv import Panic import Outputable import FastString +import SrcLoc ( noSrcSpan ) import Control.Monad ( liftM ) @@ -280,6 +281,16 @@ cloneName mk_occ name = liftM make (liftDs newUnique) (nameSrcSpan name) | otherwise = mkSystemName u occ_name +newExportedVar :: OccName -> Type -> VM Var +newExportedVar occ_name ty + = do + mod <- liftDs getModuleDs + u <- liftDs newUnique + + let name = mkExternalName u mod occ_name noSrcSpan + + return $ Id.mkExportedLocalId name ty + newLocalVar :: FastString -> Type -> VM Var newLocalVar fs ty = do -- cgit v1.2.1