Skip to content
Snippets Groups Projects
Commit 043af4d8 authored by Joachim Breitner's avatar Joachim Breitner
Browse files

Do not do common context for polymorphic functions

parent 95f5aac3
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,7 @@ process v e body
e' = mkLams bndrs fun_body'
v' = setIdType v (exprType e')
body' = replaceContext v v' cts body
in -- pprTrace "findInterestingLet" (vcat [ppr v, ppr (idArity v), pprConts cts, ppr body])
in -- pprTrace "findInterestingLet" (vcat [ppr v, ppr (idArity v), pprConts cts])
(v', mkLams bndrs fun_body', body')
_ -> (v, e, body)
......@@ -85,7 +85,6 @@ contextOf v (Var v')
= NeedsArgs (idArity v)
| otherwise
= NoUse
--contextOf v (App f (Type _)) = finish $ contextOf v f
contextOf v (App f a) =
case (contextOf v f, contextOf v a) of
(NoUse, NoUse) -> NoUse
......@@ -93,8 +92,8 @@ contextOf v (App f a) =
(NoUse, Building cts) -> Building (PassTo f : cts)
(NoUse, OneUse cts) -> OneUse cts
(NoUse, MultiUse) -> MultiUse
(NeedsArgs 1, NoUse) -> Building []
(NeedsArgs i, NoUse) -> NeedsArgs (i-1)
(NeedsArgs 1, NoUse) | isValArg a -> Building []
(NeedsArgs i, NoUse) | isValArg a -> NeedsArgs (i-1)
(NeedsArgs _, _) -> MultiUse
(Building cts, NoUse) -> Building (AppTo a : cts)
(Building _, _) -> MultiUse
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment