Commit 5633b561 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Remove some more Platform arguments

parent 2b015ce9
......@@ -1266,7 +1266,7 @@ hscGenHardCode cgguts mod_summary = do
<- {-# SCC "CoreToStg" #-}
myCoreToStg dflags this_mod prepd_binds
let prof_init = profilingInitCode platform this_mod cost_centre_info
let prof_init = profilingInitCode this_mod cost_centre_info
foreign_stubs = foreign_stubs0 `appendStubC` prof_init
------------------ Code generation ------------------
......
......@@ -61,10 +61,7 @@ cmmTopCodeGen :: RawCmmDecl
-> NatM [NatCmmDecl CmmStatics Instr]
cmmTopCodeGen (CmmProc info lab (ListGraph blocks))
= do
dflags <- getDynFlags
let platform = targetPlatform dflags
(nat_blocks,statics) <- mapAndUnzipM (basicBlockCodeGen platform) blocks
= do (nat_blocks,statics) <- mapAndUnzipM basicBlockCodeGen blocks
let proc = CmmProc info lab (ListGraph $ concat nat_blocks)
let tops = proc : concat statics
......@@ -80,12 +77,11 @@ cmmTopCodeGen (CmmData sec dat) = do
-- are indicated by the NEWBLOCK instruction. We must split up the
-- instruction stream into basic blocks again. Also, we extract
-- LDATAs here too.
basicBlockCodeGen :: Platform
-> CmmBasicBlock
basicBlockCodeGen :: CmmBasicBlock
-> NatM ( [NatBasicBlock Instr]
, [NatCmmDecl CmmStatics Instr])
basicBlockCodeGen platform cmm@(BasicBlock id stmts) = do
basicBlockCodeGen cmm@(BasicBlock id stmts) = do
instrs <- stmtsToInstrs stmts
let
(top,other_blocks,statics)
......@@ -102,7 +98,7 @@ basicBlockCodeGen platform cmm@(BasicBlock id stmts) = do
-- do intra-block sanity checking
blocksChecked
= map (checkBlock platform cmm)
= map (checkBlock cmm)
$ BasicBlock id top : other_blocks
return (blocksChecked, statics)
......
......@@ -22,17 +22,15 @@ import Instruction
import OldCmm
import Outputable
import Platform
-- | Enforce intra-block invariants.
--
checkBlock :: Platform
-> CmmBasicBlock
checkBlock :: CmmBasicBlock
-> NatBasicBlock Instr
-> NatBasicBlock Instr
checkBlock _ cmm block@(BasicBlock _ instrs)
checkBlock cmm block@(BasicBlock _ instrs)
| checkBlockInstrs instrs
= block
......
......@@ -11,7 +11,6 @@ module ProfInit (profilingInitCode) where
import CLabel
import CostCentre
import Outputable
import Platform
import StaticFlags
import FastString
import Module
......@@ -22,8 +21,8 @@ import Module
-- We must produce declarations for the cost-centres defined in this
-- module;
profilingInitCode :: Platform -> Module -> CollectedCCs -> SDoc
profilingInitCode _ this_mod (local_CCs, ___extern_CCs, singleton_CCSs)
profilingInitCode :: Module -> CollectedCCs -> SDoc
profilingInitCode this_mod (local_CCs, ___extern_CCs, singleton_CCSs)
| not opt_SccProfilingOn = empty
| otherwise
= vcat
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment