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:
66413c7
)
Allow absent State# RealWorld arguments
author
simonpj@microsoft.com
<unknown>
Thu, 23 Sep 2010 11:13:56 +0000
(11:13 +0000)
committer
simonpj@microsoft.com
<unknown>
Thu, 23 Sep 2010 11:13:56 +0000
(11:13 +0000)
compiler/stranal/WwLib.lhs
patch
|
blob
|
history
diff --git
a/compiler/stranal/WwLib.lhs
b/compiler/stranal/WwLib.lhs
index
7d78416
..
e7d0edf
100644
(file)
--- a/
compiler/stranal/WwLib.lhs
+++ b/
compiler/stranal/WwLib.lhs
@@
-20,6
+20,7
@@
import Demand ( Demand(..), DmdResult(..), Demands(..) )
import MkCore ( mkRuntimeErrorApp, aBSENT_ERROR_ID )
import MkId ( realWorldPrimId, voidArgId,
mkUnpackCase, mkProductBox )
import MkCore ( mkRuntimeErrorApp, aBSENT_ERROR_ID )
import MkId ( realWorldPrimId, voidArgId,
mkUnpackCase, mkProductBox )
+import TysPrim ( realWorldStatePrimTy )
import TysWiredIn ( tupleCon )
import Type
import Coercion ( mkSymCoercion, splitNewTypeRepCo_maybe )
import TysWiredIn ( tupleCon )
import Type
import Coercion ( mkSymCoercion, splitNewTypeRepCo_maybe )
@@
-524,8
+525,10
@@
mk_absent_let arg
| Just (tc, _) <- splitTyConApp_maybe arg_ty
, Just lit <- absentLiteralOf tc
= Just (Let (NonRec arg (Lit lit)))
| Just (tc, _) <- splitTyConApp_maybe arg_ty
, Just lit <- absentLiteralOf tc
= Just (Let (NonRec arg (Lit lit)))
+ | arg_ty `coreEqType` realWorldStatePrimTy
+ = Just (Let (NonRec arg (Var realWorldPrimId)))
| otherwise
| otherwise
- = WARN( True, ptext (sLit "No asbent value for") <+> ppr arg_ty )
+ = WARN( True, ptext (sLit "No absent value for") <+> ppr arg_ty )
Nothing
where
arg_ty = idType arg
Nothing
where
arg_ty = idType arg