X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcoreSyn%2FCoreUnfold.lhs;h=0111031a10d86dcd4c8be59585c81867b3d79bbe;hb=fcf3021036cc40a6ebe582e2b471f1824024220b;hp=f15a370337db56257d99fad43de7e15c3868ec7a;hpb=e558ad0e49507faf74961aa2b45d1ce53fe288c7;p=ghc-hetmet.git diff --git a/ghc/compiler/coreSyn/CoreUnfold.lhs b/ghc/compiler/coreSyn/CoreUnfold.lhs index f15a370..0111031 100644 --- a/ghc/compiler/coreSyn/CoreUnfold.lhs +++ b/ghc/compiler/coreSyn/CoreUnfold.lhs @@ -32,10 +32,15 @@ module CoreUnfold ( ) where IMP_Ubiq() +#if defined (__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ <= 201 IMPORT_DELOOPER(IdLoop) -- for paranoia checking; -- and also to get mkMagicUnfoldingFun IMPORT_DELOOPER(PrelLoop) -- for paranoia checking IMPORT_DELOOPER(SmplLoop) +#else +import {-# SOURCE #-} MagicUFs +import {-# SOURCE #-} Id ( Id ) +#endif import Bag ( emptyBag, unitBag, unionBags, Bag ) @@ -224,13 +229,15 @@ simple variables and constants, and type applications. exprIsTrivial (Var v) = True exprIsTrivial (Lit lit) = not (isNoRepLit lit) exprIsTrivial (App e (TyArg _)) = exprIsTrivial e +exprIsTrivial (Coerce _ _ e) = exprIsTrivial e exprIsTrivial other = False \end{code} \begin{code} -exprSmallEnoughToDup (Con _ _) = True -- Could check # of args -exprSmallEnoughToDup (Prim op _) = not (fragilePrimOp op) -- Could check # of args -exprSmallEnoughToDup (Lit lit) = not (isNoRepLit lit) +exprSmallEnoughToDup (Con _ _) = True -- Could check # of args +exprSmallEnoughToDup (Prim op _) = not (fragilePrimOp op) -- Could check # of args +exprSmallEnoughToDup (Lit lit) = not (isNoRepLit lit) +exprSmallEnoughToDup (Coerce _ _ e) = exprSmallEnoughToDup e exprSmallEnoughToDup expr = case (collectArgs expr) of { (fun, _, _, vargs) -> case fun of