projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
e8ebfa8
)
Utilities for handling closure types during vectorisation
author
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Mon, 9 Jul 2007 05:38:19 +0000
(
05:38
+0000)
committer
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Mon, 9 Jul 2007 05:38:19 +0000
(
05:38
+0000)
compiler/vectorise/Vectorise.hs
patch
|
blob
|
history
diff --git
a/compiler/vectorise/Vectorise.hs
b/compiler/vectorise/Vectorise.hs
index
d662142
..
67b82c1
100644
(file)
--- a/
compiler/vectorise/Vectorise.hs
+++ b/
compiler/vectorise/Vectorise.hs
@@
-273,3
+273,14
@@
vectType (ForAllTy tv ty)
vectType ty = pprPanic "vectType:" (ppr ty)
+isClosureTyCon :: TyCon -> Bool
+isClosureTyCon tc = tyConUnique tc == closureTyConKey
+
+splitClosureTy :: Type -> (Type, Type)
+splitClosureTy ty
+ | Just (tc, [arg_ty, res_ty]) <- splitTyConApp_maybe ty
+ , isClosureTyCon tc
+ = (arg_ty, res_ty)
+
+ | otherwise = pprPanic "splitClosureTy" (ppr ty)
+