X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2FcodeGen%2FCgBindery.lhs;h=d5a2c69d600aa3e5b606f786c47b075a59e8ef2c;hb=d31dfb32ea936c22628b508c28a36c12e631430a;hp=d7f2579e763d92b5a287374306b6e5a90ee35279;hpb=49c98d143c382a1341e1046f5ca00819a25691ba;p=ghc-hetmet.git diff --git a/compiler/codeGen/CgBindery.lhs b/compiler/codeGen/CgBindery.lhs index d7f2579..d5a2c69 100644 --- a/compiler/codeGen/CgBindery.lhs +++ b/compiler/codeGen/CgBindery.lhs @@ -19,10 +19,11 @@ module CgBindery ( nukeVolatileBinds, nukeDeadBindings, getLiveStackSlots, + getLiveStackBindings, bindArgsToStack, rebindToStack, bindNewToNode, bindNewToReg, bindArgsToRegs, - bindNewToTemp, + bindNewToTemp, getArgAmode, getArgAmodes, getCgIdInfo, getCAddrModeIfVolatile, getVolatileRegs, @@ -391,13 +392,16 @@ bindNewToNode id offset lf_info -- Create a new temporary whose unique is that in the id, -- bind the id to it, and return the addressing mode for the -- temporary. -bindNewToTemp :: Id -> FCode CmmReg +bindNewToTemp :: Id -> FCode LocalReg bindNewToTemp id - = do addBindC id (regIdInfo id temp_reg lf_info) + = do addBindC id (regIdInfo id (CmmLocal temp_reg) lf_info) return temp_reg where uniq = getUnique id - temp_reg = CmmLocal (LocalReg uniq (argMachRep (idCgRep id))) + temp_reg = LocalReg uniq (argMachRep (idCgRep id)) kind + kind = if isFollowableArg (idCgRep id) + then KindPtr + else KindNonPtr lf_info = mkLFArgument id -- Always used of things we -- know nothing about @@ -491,3 +495,14 @@ getLiveStackSlots cg_rep = rep } <- varEnvElts binds, isFollowableArg rep] } \end{code} + +\begin{code} +getLiveStackBindings :: FCode [(VirtualSpOffset, CgIdInfo)] +getLiveStackBindings + = do { binds <- getBinds + ; return [(off, bind) | + bind <- varEnvElts binds, + CgIdInfo { cg_stb = VirStkLoc off, + cg_rep = rep} <- [bind], + isFollowableArg rep] } +\end{code}