Commit b5bab055 authored by simonpj's avatar simonpj
Browse files

[project @ 2001-10-11 16:44:10 by simonpj]

Add special ILX case for Coerce
parent e55df039
......@@ -20,13 +20,15 @@ import TyCon ( isAlgTyCon )
import Literal
import Id
import Var ( Var, globalIdDetails, varType )
#ifdef ILX
import MkId ( unsafeCoerceId )
#endif
import IdInfo
import DataCon
import CostCentre ( noCCS )
import VarSet
import VarEnv
import DataCon ( dataConWrapId )
import IdInfo ( OccInfo(..) )
import Maybes ( maybeToBool )
import Name ( getOccName, isExternallyVisibleName, isDllName )
import OccName ( occNameUserString )
......@@ -356,6 +358,15 @@ coreToStgExpr (Note (SCC cc) expr)
= coreToStgExpr expr `thenLne` ( \ (expr2, fvs, escs) ->
returnLne (StgSCC cc expr2, fvs, escs) )
#ifdef ILX
-- For ILX, convert (__coerce__ to_ty from_ty e)
-- into (coerce to_ty from_ty e)
-- where coerce is real function
coreToStgExpr (Note (Coerce to_ty from_ty) expr)
= coreToStgExpr (mkApps (Var unsafeCoerceId)
[Type from_ty, Type to_ty, expr])
#endif
coreToStgExpr (Note other_note expr)
= coreToStgExpr expr
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment