projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8776493
)
Add support for name cloning to vectorisation monad
author
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Mon, 16 Jul 2007 04:48:26 +0000
(
04:48
+0000)
committer
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Mon, 16 Jul 2007 04:48:26 +0000
(
04:48
+0000)
compiler/vectorise/VectMonad.hs
patch
|
blob
|
history
diff --git
a/compiler/vectorise/VectMonad.hs
b/compiler/vectorise/VectMonad.hs
index
797342b
..
041928d
100644
(file)
--- a/
compiler/vectorise/VectMonad.hs
+++ b/
compiler/vectorise/VectMonad.hs
@@
-31,6
+31,7
@@
import Type
import Var
import VarEnv
import Id
import Var
import VarEnv
import Id
+import OccName
import Name
import NameEnv
import Name
import NameEnv
@@
-240,6
+241,16
@@
getInstEnv = readGEnv global_inst_env
getFamInstEnv :: VM FamInstEnvs
getFamInstEnv = readGEnv global_fam_inst_env
getFamInstEnv :: VM FamInstEnvs
getFamInstEnv = readGEnv global_fam_inst_env
+cloneName :: (OccName -> OccName) -> Name -> VM Name
+cloneName mk_occ name = liftM make (liftDs newUnique)
+ where
+ occ_name = mk_occ (nameOccName name)
+
+ make u | isExternalName name = mkExternalName u (nameModule name)
+ occ_name
+ (nameSrcSpan name)
+ | otherwise = mkSystemName u occ_name
+
newLocalVar :: FastString -> Type -> VM Var
newLocalVar fs ty
= do
newLocalVar :: FastString -> Type -> VM Var
newLocalVar fs ty
= do