diff options
Diffstat (limited to 'compiler/codeGen/StgCmmMonad.hs')
-rw-r--r-- | compiler/codeGen/StgCmmMonad.hs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/compiler/codeGen/StgCmmMonad.hs b/compiler/codeGen/StgCmmMonad.hs index d06b581f26..c8da75003a 100644 --- a/compiler/codeGen/StgCmmMonad.hs +++ b/compiler/codeGen/StgCmmMonad.hs @@ -13,7 +13,7 @@ module StgCmmMonad ( returnFC, fixC, fixC_, nopC, whenC, newUnique, newUniqSupply, - emit, emitData, emitProc, emitProcWithConvention, emitSimpleProc, + emit, emitDecl, emitProc, emitProcWithConvention, emitSimpleProc, getCmm, cgStmtsToBlocks, getCodeR, getCode, getHeapUsage, @@ -49,13 +49,11 @@ module StgCmmMonad ( #include "HsVersions.h" +import Cmm import StgCmmClosure import DynFlags import MkGraph import BlockId -import CmmDecl -import CmmExpr -import CmmNode (UpdFrameOffset) import CLabel import TyCon ( PrimRep ) import SMRep @@ -593,12 +591,10 @@ emit ag = do { state <- getState ; setState $ state { cgs_stmts = cgs_stmts state <*> ag } } -emitData :: Section -> CmmStatics -> FCode () -emitData sect lits +emitDecl :: CmmTop -> FCode () +emitDecl decl = do { state <- getState - ; setState $ state { cgs_tops = cgs_tops state `snocOL` data_block } } - where - data_block = CmmData sect lits + ; setState $ state { cgs_tops = cgs_tops state `snocOL` decl } } emitProcWithConvention :: Convention -> CmmInfoTable -> CLabel -> [CmmFormal] -> CmmAGraph -> FCode () @@ -618,7 +614,7 @@ emitSimpleProc :: CLabel -> CmmAGraph -> FCode () emitSimpleProc lbl code = emitProc CmmNonInfoTable lbl [] code -getCmm :: FCode () -> FCode Cmm +getCmm :: FCode () -> FCode CmmPgm -- Get all the CmmTops (there should be no stmts) -- Return a single Cmm which may be split from other Cmms by -- object splitting (at a later stage) @@ -626,7 +622,7 @@ getCmm code = do { state1 <- getState ; ((), state2) <- withState code (state1 { cgs_tops = nilOL }) ; setState $ state2 { cgs_tops = cgs_tops state1 } - ; return (Cmm (fromOL (cgs_tops state2))) } + ; return (fromOL (cgs_tops state2)) } -- ---------------------------------------------------------------------------- -- CgStmts |