Skip to content
Snippets Groups Projects
Commit abc45a98 authored by sven.panne@aedion.de's avatar sven.panne@aedion.de
Browse files

[project @ 2000-04-22 14:30:51 by panne]

Don't use coercion RULES with litlits (e.g. int2Word ``42''), once
again found by *the* GHC test, HOpenGL + Quake level viewer. :-)
parent 17160152
No related merge requests found
......@@ -15,7 +15,7 @@ module PrelRules ( primOpRule, builtinRules ) where
import CoreSyn
import Rules ( ProtoCoreRule(..) )
import Id ( idUnfolding, mkWildId, isDataConId_maybe )
import Literal ( Literal(..), mkMachInt, mkMachWord, inIntRange, literalType,
import Literal ( Literal(..), isLitLitLit, mkMachInt, mkMachWord, inIntRange, literalType,
word2IntLit, int2WordLit, int2CharLit, char2IntLit, int2FloatLit, int2DoubleLit
)
import PrimOp ( PrimOp(..), primOpOcc )
......@@ -141,7 +141,8 @@ why we have the catch-all Nothing case.
\begin{code}
--------------------------
litCoerce :: (Literal -> Literal) -> RuleName -> Literal -> Maybe (RuleName, CoreExpr)
litCoerce fn name lit = Just (name, Lit (fn lit))
litCoerce fn name lit | isLitLitLit lit = Nothing
| otherwise = Just (name, Lit (fn lit))
--------------------------
cmpOp :: (Ordering -> Bool) -> FAST_STRING -> Literal -> Literal -> Maybe (RuleName, CoreExpr)
......
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