diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-03-07 13:28:34 +0000 |
---|---|---|
committer | David Feuer <David.Feuer@gmail.com> | 2017-04-28 18:04:22 -0400 |
commit | 1cae73aa7a1bf934e3dcae943d0d1686e8b12c26 (patch) | |
tree | 0011f50a7330e20bb4aa4e057c157e319961ae18 /compiler/codeGen/StgCmmClosure.hs | |
parent | 9ac22183e405773ea7147728e593edd78f30a025 (diff) | |
download | haskell-1cae73aa7a1bf934e3dcae943d0d1686e8b12c26.tar.gz |
Move dataConTagZ to DataCon
Just a simple refactoring to remove duplication
Diffstat (limited to 'compiler/codeGen/StgCmmClosure.hs')
-rw-r--r-- | compiler/codeGen/StgCmmClosure.hs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index e799ea6639..bc5e473d20 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -13,7 +13,6 @@ module StgCmmClosure ( DynTag, tagForCon, isSmallFamily, - ConTagZ, dataConTagZ, idPrimRep, isVoidRep, isGcPtrRep, addIdReps, addArgReps, argPrimRep, @@ -360,17 +359,12 @@ type DynTag = Int -- The tag on a *pointer* isSmallFamily :: DynFlags -> Int -> Bool isSmallFamily dflags fam_size = fam_size <= mAX_PTR_TAG dflags --- We keep the *zero-indexed* tag in the srt_len field of the info --- table of a data constructor. -dataConTagZ :: DataCon -> ConTagZ -dataConTagZ con = dataConTag con - fIRST_TAG - tagForCon :: DynFlags -> DataCon -> DynTag tagForCon dflags con - | isSmallFamily dflags fam_size = con_tag + 1 + | isSmallFamily dflags fam_size = con_tag | otherwise = 1 where - con_tag = dataConTagZ con + con_tag = dataConTag con -- NB: 1-indexed fam_size = tyConFamilySize (dataConTyCon con) tagForArity :: DynFlags -> RepArity -> DynTag @@ -1050,6 +1044,8 @@ mkDataConInfoTable dflags data_con is_static ptr_wds nonptr_wds info_lbl = mkConInfoTableLabel name NoCafRefs sm_rep = mkHeapRep dflags is_static ptr_wds nonptr_wds cl_type cl_type = Constr (dataConTagZ data_con) (dataConIdentity data_con) + -- We keep the *zero-indexed* tag in the srt_len field + -- of the info table of a data constructor. prof | not (gopt Opt_SccProfilingOn dflags) = NoProfilingInfo | otherwise = ProfilingInfo ty_descr val_descr |