summaryrefslogtreecommitdiff
path: root/compiler/deSugar/DsCCall.lhs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-09-16 17:45:03 +0100
committerIan Lynagh <ian@well-typed.com>2012-09-16 17:45:03 +0100
commit17910899dacc892fd652d9206340d2bc2b2c5fc1 (patch)
treec39b870bea8c77390c19e6d9694d38aa931fc2ed /compiler/deSugar/DsCCall.lhs
parenta62b56ef0b9d1750289ffd3f77b578dc73452374 (diff)
downloadhaskell-17910899dacc892fd652d9206340d2bc2b2c5fc1.tar.gz
Move wORD_SIZE into platformConstants
Diffstat (limited to 'compiler/deSugar/DsCCall.lhs')
-rw-r--r--compiler/deSugar/DsCCall.lhs14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/deSugar/DsCCall.lhs b/compiler/deSugar/DsCCall.lhs
index a2459f5a4c..e02ef7b385 100644
--- a/compiler/deSugar/DsCCall.lhs
+++ b/compiler/deSugar/DsCCall.lhs
@@ -47,7 +47,6 @@ import BasicTypes
import Literal
import PrelNames
import VarSet
-import Constants
import DynFlags
import Outputable
import Util
@@ -357,9 +356,10 @@ resultWrapper result_ty
-- This includes types like Ptr and ForeignPtr
| Just (tycon, tycon_arg_tys, data_con, data_con_arg_tys) <- splitProductType_maybe result_ty,
dataConSourceArity data_con == 1
- = do let
+ = do dflags <- getDynFlags
+ let
(unwrapped_res_ty : _) = data_con_arg_tys
- narrow_wrapper = maybeNarrow tycon
+ narrow_wrapper = maybeNarrow dflags tycon
(maybe_ty, wrapper) <- resultWrapper unwrapped_res_ty
return
(maybe_ty, \e -> mkApps (Var (dataConWrapId data_con))
@@ -375,16 +375,16 @@ resultWrapper result_ty
-- standard appears to say that this is the responsibility of the
-- caller, not the callee.
-maybeNarrow :: TyCon -> (CoreExpr -> CoreExpr)
-maybeNarrow tycon
+maybeNarrow :: DynFlags -> TyCon -> (CoreExpr -> CoreExpr)
+maybeNarrow dflags tycon
| tycon `hasKey` int8TyConKey = \e -> App (Var (mkPrimOpId Narrow8IntOp)) e
| tycon `hasKey` int16TyConKey = \e -> App (Var (mkPrimOpId Narrow16IntOp)) e
| tycon `hasKey` int32TyConKey
- && wORD_SIZE > 4 = \e -> App (Var (mkPrimOpId Narrow32IntOp)) e
+ && wORD_SIZE dflags > 4 = \e -> App (Var (mkPrimOpId Narrow32IntOp)) e
| tycon `hasKey` word8TyConKey = \e -> App (Var (mkPrimOpId Narrow8WordOp)) e
| tycon `hasKey` word16TyConKey = \e -> App (Var (mkPrimOpId Narrow16WordOp)) e
| tycon `hasKey` word32TyConKey
- && wORD_SIZE > 4 = \e -> App (Var (mkPrimOpId Narrow32WordOp)) e
+ && wORD_SIZE dflags > 4 = \e -> App (Var (mkPrimOpId Narrow32WordOp)) e
| otherwise = id
\end{code}