X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcodeGen%2FCgCon.lhs;h=a2c8578d1890a989f37ec4d0b87fbbe32a8daf4f;hb=f6a741fad12b14b102be1aca959b8d63cbb2734a;hp=115439a0fd93038d9a6070d997c41d4b8ad8d244;hpb=61d2625ae2e6a4cdae2ffc92df828905e81c24cc;p=ghc-hetmet.git diff --git a/compiler/codeGen/CgCon.lhs b/compiler/codeGen/CgCon.lhs index 115439a..a2c8578 100644 --- a/compiler/codeGen/CgCon.lhs +++ b/compiler/codeGen/CgCon.lhs @@ -1,4 +1,5 @@ % +% (c) The University of Glasgow 2006 % (c) The GRASP Project, Glasgow University, 1992-1998 % \section[CgCon]{Code generation for constructors} @@ -20,40 +21,30 @@ module CgCon ( import CgMonad import StgSyn -import CgBindery ( getArgAmodes, bindNewToNode, - bindArgsToRegs, idInfoToAmode, stableIdInfo, - heapIdInfo, CgIdInfo, bindArgsToStack - ) -import CgStackery ( mkVirtStkOffsets, freeStackSlots, - getRealSp, getVirtSp, setRealAndVirtualSp ) -import CgUtils ( addIdReps, cmmLabelOffW, emitRODataLits, emitDataLits ) -import CgCallConv ( assignReturnRegs ) -import CgHeapery ( allocDynClosure, layOutDynConstr, - layOutStaticConstr, mkStaticClosureFields ) -import CgTailCall ( performReturn, emitKnownConReturnCode, returnUnboxedTuple ) -import CgProf ( mkCCostCentreStack, ldvEnter, curCCS ) +import CgBindery +import CgStackery +import CgUtils +import CgCallConv +import CgHeapery +import CgTailCall +import CgProf import CgTicky -import CgInfoTbls ( emitClosureCodeAndInfoTable, dataConTagZ ) +import CgInfoTbls import CLabel -import ClosureInfo ( mkConLFInfo, mkLFArgument ) -import CmmUtils ( mkLblExpr ) +import ClosureInfo +import CmmUtils import Cmm -import SMRep ( WordOff, CgRep, separateByPtrFollowness, - fixedHdrSize, typeCgRep ) -import CostCentre ( currentOrSubsumedCCS, dontCareCCS, CostCentreStack, - currentCCS ) -import Constants ( mIN_INTLIKE, mAX_INTLIKE, mIN_CHARLIKE, mAX_CHARLIKE ) -import TyCon ( TyCon, tyConDataCons, isEnumerationTyCon, tyConName ) -import DataCon ( DataCon, dataConRepArgTys, isNullaryRepDataCon, - isUnboxedTupleCon, dataConWorkId, - dataConName, dataConRepArity - ) -import Id ( Id, idName, isDeadBinder ) -import Type ( Type ) -import PrelInfo ( maybeCharLikeCon, maybeIntLikeCon ) +import SMRep +import CostCentre +import Constants +import TyCon +import DataCon +import Id +import Type +import PrelInfo import Outputable -import Util ( lengthIs ) -import ListSetOps ( assocMaybe ) +import Util +import ListSetOps \end{code} @@ -304,7 +295,7 @@ cgReturnDataCon con amodes = ASSERT( amodes `lengthIs` dataConRepArity con ) do { EndOfBlockInfo _ sequel <- getEndOfBlockInfo ; case sequel of - CaseAlts _ (Just (alts, deflt_lbl)) bndr _ + CaseAlts _ (Just (alts, deflt_lbl)) bndr -> -- Ho! We know the constructor so we can -- go straight to the right alternative case assocMaybe alts (dataConTagZ con) of { @@ -326,7 +317,7 @@ cgReturnDataCon con amodes other_sequel -- The usual case | isUnboxedTupleCon con -> returnUnboxedTuple amodes - | otherwise -> build_it_then (emitKnownConReturnCode con) + | otherwise -> build_it_then emitReturnInstr } where jump_to lbl = stmtC (CmmJump (CmmLit lbl) []) @@ -443,7 +434,7 @@ cgDataCon data_con body_code = do { -- NB: We don't set CC when entering data (WDP 94/06) tickyReturnOldCon (length arg_things) - ; performReturn (emitKnownConReturnCode data_con) } + ; performReturn emitReturnInstr } -- noStmts: Ptr to thing already in Node ; whenC (not (isNullaryRepDataCon data_con)) @@ -451,6 +442,4 @@ cgDataCon data_con -- Dynamic-Closure first, to reduce forward references ; emit_info static_cl_info tickyEnterStaticCon } - - where \end{code}