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:
2ad8a88
)
Utility functions for accessing the RdrEnv during vectorisation
author
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Tue, 7 Aug 2007 02:28:18 +0000
(
02:28
+0000)
committer
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Tue, 7 Aug 2007 02:28:18 +0000
(
02:28
+0000)
compiler/vectorise/VectMonad.hs
patch
|
blob
|
history
diff --git
a/compiler/vectorise/VectMonad.hs
b/compiler/vectorise/VectMonad.hs
index
56efb2b
..
36e0d97
100644
(file)
--- a/
compiler/vectorise/VectMonad.hs
+++ b/
compiler/vectorise/VectMonad.hs
@@
-312,6
+312,21
@@
inBind id p
= do updLEnv $ \env -> env { local_bind_name = occNameFS (getOccName id) }
p
= do updLEnv $ \env -> env { local_bind_name = occNameFS (getOccName id) }
p
+lookupRdrName :: RdrName -> VM Name
+lookupRdrName rdr_name
+ = do
+ rdr_env <- readGEnv global_rdr_env
+ case lookupGRE_RdrName rdr_name rdr_env of
+ [gre] -> return (gre_name gre)
+ [] -> pprPanic "VectMonad.lookupRdrName: not found" (ppr rdr_name)
+ _ -> pprPanic "VectMonad.lookupRdrName: ambiguous" (ppr rdr_name)
+
+lookupRdrVar :: RdrName -> VM Var
+lookupRdrVar rdr_name
+ = do
+ name <- lookupRdrName rdr_name
+ liftDs (dsLookupGlobalId name)
+
cloneName :: (OccName -> OccName) -> Name -> VM Name
cloneName mk_occ name = liftM make (liftDs newUnique)
where
cloneName :: (OccName -> OccName) -> Name -> VM Name
cloneName mk_occ name = liftM make (liftDs newUnique)
where