summaryrefslogtreecommitdiff
path: root/compiler/specialise/SpecConstr.lhs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-08-23 16:35:11 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-08-23 16:35:11 +0100
commitb04ff2fe83d8a5f9c176739559ac722521a7bdcc (patch)
tree75e5470aec588ae634d9e0a7c559e5521d5898b5 /compiler/specialise/SpecConstr.lhs
parentad33998ce15b42287b460a112226e1d35a42c232 (diff)
downloadhaskell-b04ff2fe83d8a5f9c176739559ac722521a7bdcc.tar.gz
Two small fixes to SpecConstr for functions with equality-proof args
First, make Rules.match_co able to deal wit some modest coercions Second, make SpecConstr use wild-card for coercion arguments This is the rest of the fix for Trac #7165
Diffstat (limited to 'compiler/specialise/SpecConstr.lhs')
-rw-r--r--compiler/specialise/SpecConstr.lhs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/specialise/SpecConstr.lhs b/compiler/specialise/SpecConstr.lhs
index 995d6212ce..7661878ac1 100644
--- a/compiler/specialise/SpecConstr.lhs
+++ b/compiler/specialise/SpecConstr.lhs
@@ -1585,9 +1585,6 @@ argToPat :: ScEnv
argToPat _env _in_scope _val_env arg@(Type {}) _arg_occ
= return (False, arg)
-argToPat _env _in_scope _val_env arg@(Coercion {}) _arg_occ
- = return (False, arg)
-
argToPat env in_scope val_env (Tick _ arg) arg_occ
= argToPat env in_scope val_env arg arg_occ
-- Note [Notes in call patterns]
@@ -1696,6 +1693,7 @@ argToPat env in_scope val_env (Var v) arg_occ
-- We don't want to specialise for that *particular* x,y
-- The default case: make a wild-card
+ -- We use this for coercions too
argToPat _env _in_scope _val_env arg _arg_occ
= wildCardPat (exprType arg)
@@ -1703,7 +1701,7 @@ wildCardPat :: Type -> UniqSM (Bool, CoreArg)
wildCardPat ty
= do { uniq <- getUniqueUs
; let id = mkSysLocal (fsLit "sc") uniq ty
- ; return (False, Var id) }
+ ; return (False, varToCoreExpr id) }
argsToPats :: ScEnv -> InScopeSet -> ValueEnv
-> [CoreArg] -> [ArgOcc] -- Should be same length