summaryrefslogtreecommitdiff
path: root/compiler/codeGen
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-06-13 16:38:27 +0100
committerIan Lynagh <igloo@earth.li>2012-06-13 16:38:27 +0100
commit7937a9212159012606939fcbc6b38d9fe5db5584 (patch)
tree1452d3b0b994ab4b381f4aa32ae59a23ac2e2f5e /compiler/codeGen
parent03f78f0686f048e75d671f2797c8684b71655c49 (diff)
downloadhaskell-7937a9212159012606939fcbc6b38d9fe5db5584.tar.gz
Remove some unnecessary platform arguments
Diffstat (limited to 'compiler/codeGen')
-rw-r--r--compiler/codeGen/StgCmmBind.hs10
-rw-r--r--compiler/codeGen/StgCmmClosure.hs21
-rw-r--r--compiler/codeGen/StgCmmHeap.hs9
-rw-r--r--compiler/codeGen/StgCmmLayout.hs6
-rw-r--r--compiler/codeGen/StgCmmTicky.hs3
5 files changed, 18 insertions, 31 deletions
diff --git a/compiler/codeGen/StgCmmBind.hs b/compiler/codeGen/StgCmmBind.hs
index 4f9d1b507c..3b166e3b6a 100644
--- a/compiler/codeGen/StgCmmBind.hs
+++ b/compiler/codeGen/StgCmmBind.hs
@@ -411,9 +411,7 @@ closureCodeBody top_lvl bndr cl_info _cc args arity body fv_details
do { -- Allocate the global ticky counter,
-- and establish the ticky-counter
-- label for this block
- ; dflags <- getDynFlags
- ; let platform = targetPlatform dflags
- ticky_ctr_lbl = closureRednCountsLabel platform cl_info
+ let ticky_ctr_lbl = closureRednCountsLabel cl_info
; emitTickyCounter cl_info (map stripNV args)
; setTickyCtrLabel ticky_ctr_lbl $ do
@@ -470,10 +468,8 @@ mkSlowEntryCode :: ClosureInfo -> [LocalReg] -> FCode ()
mkSlowEntryCode _ [] = panic "entering a closure with no arguments?"
mkSlowEntryCode cl_info arg_regs -- function closure is already in `Node'
| Just (_, ArgGen _) <- closureFunInfo cl_info
- = do dflags <- getDynFlags
- let platform = targetPlatform dflags
- slow_lbl = closureSlowEntryLabel platform cl_info
- fast_lbl = closureLocalEntryLabel platform cl_info
+ = do let slow_lbl = closureSlowEntryLabel cl_info
+ fast_lbl = closureLocalEntryLabel cl_info
-- mkDirectJump does not clobber `Node' containing function closure
jump = mkDirectJump (mkLblExpr fast_lbl)
(map (CmmReg . CmmLocal) arg_regs)
diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs
index de7ab3d11a..aaecdd3e4b 100644
--- a/compiler/codeGen/StgCmmClosure.hs
+++ b/compiler/codeGen/StgCmmClosure.hs
@@ -87,7 +87,6 @@ import TcType
import TyCon
import BasicTypes
import Outputable
-import Platform
import Constants
import DynFlags
import Util
@@ -773,19 +772,19 @@ isToplevClosure (ClosureInfo { closureLFInfo = lf_info })
-- Label generation
--------------------------------------
-staticClosureLabel :: Platform -> ClosureInfo -> CLabel
-staticClosureLabel platform = toClosureLbl platform . closureInfoLabel
+staticClosureLabel :: ClosureInfo -> CLabel
+staticClosureLabel = toClosureLbl . closureInfoLabel
-closureRednCountsLabel :: Platform -> ClosureInfo -> CLabel
-closureRednCountsLabel platform = toRednCountsLbl platform . closureInfoLabel
+closureRednCountsLabel :: ClosureInfo -> CLabel
+closureRednCountsLabel = toRednCountsLbl . closureInfoLabel
-closureSlowEntryLabel :: Platform -> ClosureInfo -> CLabel
-closureSlowEntryLabel platform = toSlowEntryLbl platform . closureInfoLabel
+closureSlowEntryLabel :: ClosureInfo -> CLabel
+closureSlowEntryLabel = toSlowEntryLbl . closureInfoLabel
-closureLocalEntryLabel :: Platform -> ClosureInfo -> CLabel
-closureLocalEntryLabel platform
- | tablesNextToCode = toInfoLbl platform . closureInfoLabel
- | otherwise = toEntryLbl platform . closureInfoLabel
+closureLocalEntryLabel :: ClosureInfo -> CLabel
+closureLocalEntryLabel
+ | tablesNextToCode = toInfoLbl . closureInfoLabel
+ | otherwise = toEntryLbl . closureInfoLabel
mkClosureInfoTableLabel :: Id -> LambdaFormInfo -> CLabel
mkClosureInfoTableLabel id lf_info
diff --git a/compiler/codeGen/StgCmmHeap.hs b/compiler/codeGen/StgCmmHeap.hs
index 7b22c5726a..25161722f7 100644
--- a/compiler/codeGen/StgCmmHeap.hs
+++ b/compiler/codeGen/StgCmmHeap.hs
@@ -43,7 +43,6 @@ import IdInfo( CafInfo(..), mayHaveCafRefs )
import Module
import FastString( mkFastString, fsLit )
import Constants
-import DynFlags
import Util
-----------------------------------------------------------
@@ -329,11 +328,7 @@ entryHeapCheck :: ClosureInfo
-> FCode ()
entryHeapCheck cl_info offset nodeSet arity args code
- = do dflags <- getDynFlags
-
- let platform = targetPlatform dflags
-
- is_thunk = arity == 0
+ = do let is_thunk = arity == 0
is_fastf = case closureFunInfo cl_info of
Just (_, ArgGen _) -> False
_otherwise -> True
@@ -342,7 +337,7 @@ entryHeapCheck cl_info offset nodeSet arity args code
setN = case nodeSet of
Just n -> mkAssign nodeReg (CmmReg $ CmmLocal n)
Nothing -> mkAssign nodeReg $
- CmmLit (CmmLabel $ staticClosureLabel platform cl_info)
+ CmmLit (CmmLabel $ staticClosureLabel cl_info)
{- Thunks: Set R1 = node, jump GCEnter1
Function (fast): Set R1 = node, jump GCFun
diff --git a/compiler/codeGen/StgCmmLayout.hs b/compiler/codeGen/StgCmmLayout.hs
index 87e6d9f9dd..86986efdfa 100644
--- a/compiler/codeGen/StgCmmLayout.hs
+++ b/compiler/codeGen/StgCmmLayout.hs
@@ -51,7 +51,6 @@ import Id
import Name
import TyCon ( PrimRep(..) )
import BasicTypes ( RepArity )
-import DynFlags
import StaticFlags
import Constants
@@ -405,9 +404,8 @@ emitClosureProcAndInfoTable top_lvl bndr lf_info info_tbl args body
emitClosureAndInfoTable ::
CmmInfoTable -> Convention -> [LocalReg] -> FCode () -> FCode ()
emitClosureAndInfoTable info_tbl conv args body
- = do { dflags <- getDynFlags
- ; blks <- getCode body
- ; let entry_lbl = toEntryLbl (targetPlatform dflags) (cit_lbl info_tbl)
+ = do { blks <- getCode body
+ ; let entry_lbl = toEntryLbl (cit_lbl info_tbl)
; emitProcWithConvention conv info_tbl entry_lbl args blks
}
diff --git a/compiler/codeGen/StgCmmTicky.hs b/compiler/codeGen/StgCmmTicky.hs
index 66dde86226..d0432315ab 100644
--- a/compiler/codeGen/StgCmmTicky.hs
+++ b/compiler/codeGen/StgCmmTicky.hs
@@ -97,8 +97,7 @@ emitTickyCounter cl_info args
= ifTicky $
do { dflags <- getDynFlags
; mod_name <- getModuleName
- ; let platform = targetPlatform dflags
- ticky_ctr_label = closureRednCountsLabel platform cl_info
+ ; let ticky_ctr_label = closureRednCountsLabel cl_info
arg_descr = map (showTypeCategory . idType) args
fun_descr mod_name = ppr_for_ticky_name dflags mod_name (closureName cl_info)
; fun_descr_lit <- newStringCLit (fun_descr mod_name)