summaryrefslogtreecommitdiff
path: root/compiler/codeGen/CgUtils.hs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-09-16 20:55:26 +0100
committerIan Lynagh <ian@well-typed.com>2012-09-16 20:55:26 +0100
commitb0f4c44ed777af599daf35035b0830b35e57fa4a (patch)
treeb2a96dbf9ca11cbcd3098d91ef6c368d8c538199 /compiler/codeGen/CgUtils.hs
parent7ecefb6b30c3b249bba0454586c4a008d66d567b (diff)
downloadhaskell-b0f4c44ed777af599daf35035b0830b35e57fa4a.tar.gz
Move tAG_BITS into platformConstants
Diffstat (limited to 'compiler/codeGen/CgUtils.hs')
-rw-r--r--compiler/codeGen/CgUtils.hs15
1 files changed, 7 insertions, 8 deletions
diff --git a/compiler/codeGen/CgUtils.hs b/compiler/codeGen/CgUtils.hs
index ab64f56c4b..c52c8a8c99 100644
--- a/compiler/codeGen/CgUtils.hs
+++ b/compiler/codeGen/CgUtils.hs
@@ -53,7 +53,6 @@ import TyCon
import DataCon
import Id
import IdInfo
-import Constants
import SMRep
import OldCmm
import OldCmmUtils
@@ -142,20 +141,20 @@ mkLtOp dflags lit = MO_U_Lt (typeWidth (cmmLitType dflags (mkSimpleLi
Big families only use the tag value 1 to represent
evaluatedness.
-}
-isSmallFamily :: Int -> Bool
-isSmallFamily fam_size = fam_size <= mAX_PTR_TAG
+isSmallFamily :: DynFlags -> Int -> Bool
+isSmallFamily dflags fam_size = fam_size <= mAX_PTR_TAG dflags
-tagForCon :: DataCon -> ConTagZ
-tagForCon con = tag
+tagForCon :: DynFlags -> DataCon -> ConTagZ
+tagForCon dflags con = tag
where
con_tag = dataConTagZ con
fam_size = tyConFamilySize (dataConTyCon con)
- tag | isSmallFamily fam_size = con_tag + 1
- | otherwise = 1
+ tag | isSmallFamily dflags fam_size = con_tag + 1
+ | otherwise = 1
--Tag an expression, to do: refactor, this appears in some other module.
tagCons :: DynFlags -> DataCon -> CmmExpr -> CmmExpr
-tagCons dflags con expr = cmmOffsetB dflags expr (tagForCon con)
+tagCons dflags con expr = cmmOffsetB dflags expr (tagForCon dflags con)
--------------------------------------------------------------------------
--