diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs index 5cafdf468d549acb3760a911950cb95829d4c9e8..b386db260191d83ffad393abc628bef6beb194a7 100644 --- a/compiler/cmm/CLabel.hs +++ b/compiler/cmm/CLabel.hs @@ -101,7 +101,6 @@ module CLabel ( hasCAF, entryLblToInfoLbl, cvtToClosureLbl, cvtToSRTLbl, - localiseLabel, needsCDecl, isAsmTemp, maybeAsmTemp, externallyVisibleCLabel, isMathFun, isCFunctionLabel, isGcPtrLabel, labelDynamic, @@ -530,11 +529,6 @@ cvtToSRTLbl l@(IdLabel n c Closure) = mkSRTLabel n c cvtToSRTLbl l = pprPanic "cvtToSRTLbl" (pprCLabel l) -localiseLabel :: CLabel -> CLabel -localiseLabel (IdLabel n c (Entry _)) = IdLabel n c (Entry True) -localiseLabel (IdLabel n c (InfoTable _)) = IdLabel n c (InfoTable True) -localiseLabel l = l - -- ----------------------------------------------------------------------------- -- Does a CLabel refer to a CAF? diff --git a/compiler/codeGen/ClosureInfo.lhs b/compiler/codeGen/ClosureInfo.lhs index 5db8b125f70431283ad93c5a18caaaa5b1fae9e8..60f1bda7f54b1932ae9679b66f2829a62a55ca90 100644 --- a/compiler/codeGen/ClosureInfo.lhs +++ b/compiler/codeGen/ClosureInfo.lhs @@ -80,8 +80,6 @@ import FastString import Outputable import Constants import DynFlags - -import Control.Arrow ((***)) \end{code} @@ -936,7 +934,7 @@ labelsFromCI :: ClosureInfo -> (CLabel, CLabel) -- (Info, Entry) labelsFromCI cl@(ClosureInfo { closureName = name, closureLFInfo = lf_info, closureInfLcl = is_lcl }) - = (if is_lcl then (localiseLabel *** localiseLabel) else id) $ case lf_info of + = case lf_info of LFBlackHole -> (mkCAFBlackHoleInfoTableLabel, mkCAFBlackHoleEntryLabel) LFThunk _ _ upd_flag (SelectorThunk offset) _ -> @@ -945,11 +943,12 @@ labelsFromCI cl@(ClosureInfo { closureName = name, LFThunk _ _ upd_flag (ApThunk arity) _ -> bothL (mkApInfoTableLabel, mkApEntryLabel) upd_flag arity - LFThunk{} -> bothL (mkInfoTableLabel, mkEntryLabel) name $ clHasCafRefs cl + LFThunk{} -> bothL std_mk_lbls name $ clHasCafRefs cl - LFReEntrant _ _ _ _ -> bothL (mkInfoTableLabel, mkEntryLabel) name $ clHasCafRefs cl + LFReEntrant _ _ _ _ -> bothL std_mk_lbls name $ clHasCafRefs cl _ -> panic "labelsFromCI" + where std_mk_lbls = if is_lcl then (mkLocalInfoTableLabel, mkLocalEntryLabel) else (mkInfoTableLabel, mkEntryLabel) labelsFromCI cl@(ConInfo { closureCon = con, closureSMRep = rep }) diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index cbcdaab058fbc552f7dc64f20f7d9e6acfb5efc4..2492bafc6c4ccbcb3e34a610579d874480e259fb 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -90,8 +90,6 @@ import Outputable import Constants import DynFlags -import Control.Arrow ((***)) - ----------------------------------------------------------------------------- -- Representations ----------------------------------------------------------------------------- @@ -1003,7 +1001,7 @@ labelsFromCI :: ClosureInfo -> (CLabel, CLabel) -- (Info, Entry) labelsFromCI cl@(ClosureInfo { closureName = name, closureLFInfo = lf_info, closureInfLcl = is_lcl }) - = (if is_lcl then (localiseLabel *** localiseLabel) else id) $ case lf_info of + = case lf_info of LFBlackHole -> (mkCAFBlackHoleInfoTableLabel, mkCAFBlackHoleEntryLabel) LFThunk _ _ upd_flag (SelectorThunk offset) _ -> @@ -1012,11 +1010,12 @@ labelsFromCI cl@(ClosureInfo { closureName = name, LFThunk _ _ upd_flag (ApThunk arity) _ -> bothL (mkApInfoTableLabel, mkApEntryLabel) upd_flag arity - LFThunk{} -> bothL (mkInfoTableLabel, mkEntryLabel) name $ clHasCafRefs cl + LFThunk{} -> bothL std_mk_lbls name $ clHasCafRefs cl - LFReEntrant _ _ _ _ -> bothL (mkInfoTableLabel, mkEntryLabel) name $ clHasCafRefs cl + LFReEntrant _ _ _ _ -> bothL std_mk_lbls name $ clHasCafRefs cl _other -> panic "labelsFromCI" + where std_mk_lbls = if is_lcl then (mkLocalInfoTableLabel, mkLocalEntryLabel) else (mkInfoTableLabel, mkEntryLabel) labelsFromCI cl@(ConInfo { closureCon = con, closureSMRep = rep }) | isStaticRep rep = bothL (mkStaticInfoTableLabel, mkStaticConEntryLabel) name $ clHasCafRefs cl