diff options
Diffstat (limited to 'compiler/codeGen')
-rw-r--r-- | compiler/codeGen/CgCon.lhs | 3 | ||||
-rw-r--r-- | compiler/codeGen/CgMonad.lhs | 10 | ||||
-rw-r--r-- | compiler/codeGen/CgTailCall.lhs | 12 | ||||
-rw-r--r-- | compiler/codeGen/CodeGen.lhs | 4 |
4 files changed, 22 insertions, 7 deletions
diff --git a/compiler/codeGen/CgCon.lhs b/compiler/codeGen/CgCon.lhs index 5269e4ec41..bf4cf3d9e7 100644 --- a/compiler/codeGen/CgCon.lhs +++ b/compiler/codeGen/CgCon.lhs @@ -397,6 +397,9 @@ cgTyCon tycon -- datatype closure table (for enumeration types) -- to (say) PrelBase_$wTrue_closure, which is defined in code_stuff -- Note that the closure pointers are tagged. + + -- XXX comment says to put table after constructor decls, but + -- code appears to put it before --- NR 16 Aug 2007 ; extra <- if isEnumerationTyCon tycon then do tbl <- getCmm (emitRODataLits (mkLocalClosureTableLabel diff --git a/compiler/codeGen/CgMonad.lhs b/compiler/codeGen/CgMonad.lhs index faa84c2174..7b2ee7dcab 100644 --- a/compiler/codeGen/CgMonad.lhs +++ b/compiler/codeGen/CgMonad.lhs @@ -80,9 +80,9 @@ import Id import VarEnv import OrdList import Unique -import Util +import Util() import UniqSupply -import FastString +import FastString() import Outputable import Control.Monad @@ -241,6 +241,7 @@ flattenCgStmts id stmts = where (block,blocks) = flatten stmts (CgFork fork_id stmts : ss) -> flatten (CgFork fork_id stmts : CgStmt stmt : ss) + (CgStmt {} : _) -> panic "CgStmt not seen as ordinary" flatten (s:ss) = case s of @@ -711,7 +712,8 @@ labelC :: BlockId -> Code labelC id = emitCgStmt (CgLabel id) newLabelC :: FCode BlockId -newLabelC = do { id <- newUnique; return (BlockId id) } +newLabelC = do { us <- newUniqSupply + ; return $ initUs_ us (freshBlockId "LabelC") } checkedAbsC :: CmmStmt -> Code -- Emit code, eliminating no-ops @@ -758,6 +760,8 @@ emitSimpleProc lbl code getCmm :: Code -> FCode Cmm -- 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) getCmm code = do { state1 <- getState ; ((), state2) <- withState code (state1 { cgs_tops = nilOL }) diff --git a/compiler/codeGen/CgTailCall.lhs b/compiler/codeGen/CgTailCall.lhs index 16369ab573..cd100e8f21 100644 --- a/compiler/codeGen/CgTailCall.lhs +++ b/compiler/codeGen/CgTailCall.lhs @@ -34,7 +34,6 @@ import CgUtils import CgTicky import ClosureInfo import SMRep -import MachOp import Cmm import CmmUtils import CLabel @@ -227,6 +226,7 @@ performTailCall fun_info arg_amodes pending_assts where --cond1 tag = cmmULtWord tag lowCons -- More efficient than the above? +{- tag_expr = cmmGetClosureType (CmmReg nodeReg) cond1 tag = cmmEqWord tag (CmmLit (mkIntCLit 0)) cond2 tag = cmmUGtWord tag highCons @@ -234,11 +234,9 @@ performTailCall fun_info arg_amodes pending_assts -- CONSTR highCons = CmmLit (mkIntCLit 8) -- CONSTR_NOCAF_STATIC (from ClosureType.h) +-} -untagCmmAssign (CmmAssign r cmmExpr) = CmmAssign r (cmmUntag cmmExpr) -untagCmmAssign stmt = stmt - directCall sp lbl args extra_args assts = do let -- First chunk of args go in registers @@ -475,3 +473,9 @@ adjustSpAndHp newRealSp ; setRealHp vHp } \end{code} + +Some things are unused. +\begin{code} +_unused :: FS.FastString +_unused = undefined +\end{code} diff --git a/compiler/codeGen/CodeGen.lhs b/compiler/codeGen/CodeGen.lhs index ee25300277..a53ff49621 100644 --- a/compiler/codeGen/CodeGen.lhs +++ b/compiler/codeGen/CodeGen.lhs @@ -70,6 +70,10 @@ codeGen :: DynFlags -> HpcInfo -> IO [Cmm] -- Output + -- N.B. returning '[Cmm]' and not 'Cmm' here makes it + -- possible for object splitting to split up the + -- pieces later. + codeGen dflags this_mod data_tycons imported_mods cost_centre_info stg_binds hpc_info = do |