summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Leshchinskiy <rl@cse.unsw.edu.au>2007-08-03 03:02:37 +0000
committerRoman Leshchinskiy <rl@cse.unsw.edu.au>2007-08-03 03:02:37 +0000
commit17f2929d489cb59ce009377e7379ca230d3411b0 (patch)
tree7ff7d3475a8f1fdb685d37daa4f953e386728556
parent2b6729b13977b9fdc4a2120a0bbb7c0865b93198 (diff)
downloadhaskell-17f2929d489cb59ce009377e7379ca230d3411b0.tar.gz
Add utility functions for accessing PA info during vectorisation
-rw-r--r--compiler/vectorise/VectMonad.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/vectorise/VectMonad.hs b/compiler/vectorise/VectMonad.hs
index b31d798c3e..571350dc3e 100644
--- a/compiler/vectorise/VectMonad.hs
+++ b/compiler/vectorise/VectMonad.hs
@@ -21,6 +21,7 @@ module VectMonad (
lookupVar, defGlobalVar,
lookupTyCon, defTyCon,
lookupDataCon, defDataCon,
+ lookupTyConPA, defTyConPA,
lookupTyVarPA, defLocalTyVar, defLocalTyVarWithPA, localTyVars,
lookupInst, lookupFamInst
@@ -383,6 +384,13 @@ defDataCon :: DataCon -> DataCon -> VM ()
defDataCon dc dc' = updGEnv $ \env ->
env { global_datacons = extendNameEnv (global_datacons env) (dataConName dc) dc' }
+lookupTyConPA :: TyCon -> VM (Maybe Var)
+lookupTyConPA tc = readGEnv $ \env -> lookupNameEnv (global_pa_funs env) (tyConName tc)
+
+defTyConPA :: TyCon -> Var -> VM ()
+defTyConPA tc pa = updGEnv $ \env ->
+ env { global_pa_funs = extendNameEnv (global_pa_funs env) (tyConName tc) pa }
+
lookupTyVarPA :: Var -> VM (Maybe CoreExpr)
lookupTyVarPA tv = readLEnv $ \env -> lookupVarEnv (local_tyvar_pa env) tv