From: simonpj Date: Thu, 11 Oct 2001 16:44:10 +0000 (+0000) Subject: [project @ 2001-10-11 16:44:10 by simonpj] X-Git-Tag: Approximately_9120_patches~848 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=b5bab055aeadc91b6a497551a1aff95bdaa9beb9;p=ghc-hetmet.git [project @ 2001-10-11 16:44:10 by simonpj] Add special ILX case for Coerce --- diff --git a/ghc/compiler/stgSyn/CoreToStg.lhs b/ghc/compiler/stgSyn/CoreToStg.lhs index 659e15d..da043d0 100644 --- a/ghc/compiler/stgSyn/CoreToStg.lhs +++ b/ghc/compiler/stgSyn/CoreToStg.lhs @@ -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