Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
b5bab055
Commit
b5bab055
authored
Oct 11, 2001
by
simonpj
Browse files
[project @ 2001-10-11 16:44:10 by simonpj]
Add special ILX case for Coerce
parent
e55df039
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/stgSyn/CoreToStg.lhs
View file @
b5bab055
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment