X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=ghc%2Fcompiler%2FcodeGen%2FCgBindery.lhs;h=f78edda6554b1f8376159ac3ae015181b0acae1f;hb=d8afca91db837cc59ae505d113210c655d68c7b6;hp=0f858777c273f06eafbdbb6f49eeea8c12c2afaa;hpb=423d477bfecd490de1449c59325c8776f91d7aac;p=ghc-hetmet.git diff --git a/ghc/compiler/codeGen/CgBindery.lhs b/ghc/compiler/codeGen/CgBindery.lhs index 0f85877..f78edda 100644 --- a/ghc/compiler/codeGen/CgBindery.lhs +++ b/ghc/compiler/codeGen/CgBindery.lhs @@ -91,7 +91,7 @@ voidIdInfo id = CgIdInfo { cg_id = id, cg_vol = NoVolatileLoc , cg_rep = VoidArg } -- Used just for VoidRep things -data VolatileLoc +data VolatileLoc -- These locations die across a call = NoVolatileLoc | RegLoc CmmReg -- In one of the registers (global or local) | VirHpLoc VirtualHpOffset -- Hp+offset (address of closure) @@ -165,7 +165,7 @@ idInfoToAmode info VirStkLoc sp_off -> do { sp_rel <- getSpRelOffset sp_off ; return (CmmLoad sp_rel mach_rep) } - VirStkLNE sp_off -> getSpRelOffset sp_off ; + VirStkLNE sp_off -> getSpRelOffset sp_off VoidLoc -> return $ pprPanic "idInfoToAmode: void" (ppr (cg_id info)) -- We return a 'bottom' amode, rather than panicing now @@ -236,7 +236,12 @@ getCgIdInfo id Nothing -> -- Should be imported; make up a CgIdInfo for it - if isExternalName name then + let + name = idName id + in + if isExternalName name then do + hmods <- getHomeModules + let ext_lbl = CmmLit (CmmLabel (mkClosureLabel hmods name)) return (stableIdInfo id ext_lbl (mkLFImported id)) else if isVoidArg (idCgRep id) then @@ -246,9 +251,7 @@ getCgIdInfo id -- Bug cgLookupPanic id }}}} - where - name = idName id - ext_lbl = CmmLit (CmmLabel (mkClosureLabel name)) + cgLookupPanic :: Id -> FCode a cgLookupPanic id @@ -258,9 +261,9 @@ cgLookupPanic id pprPanic "cgPanic" (vcat [ppr id, ptext SLIT("static binds for:"), - vcat [ ppr (cg_id info) | info <- rngVarEnv static_binds ], + vcat [ ppr (cg_id info) | info <- varEnvElts static_binds ], ptext SLIT("local binds for:"), - vcat [ ppr (cg_id info) | info <- rngVarEnv local_binds ], + vcat [ ppr (cg_id info) | info <- varEnvElts local_binds ], ptext SLIT("SRT label") <+> pprCLabel srt ]) \end{code} @@ -277,7 +280,7 @@ we don't leave any (NoVolatile, NoStable) binds around... \begin{code} nukeVolatileBinds :: CgBindings -> CgBindings nukeVolatileBinds binds - = mkVarEnv (foldr keep_if_stable [] (rngVarEnv binds)) + = mkVarEnv (foldr keep_if_stable [] (varEnvElts binds)) where keep_if_stable (CgIdInfo { cg_stb = NoStableLoc }) acc = acc keep_if_stable info acc @@ -443,7 +446,7 @@ nukeDeadBindings live_vars = do let (dead_stk_slots, bs') = dead_slots live_vars [] [] - [ (cg_id b, b) | b <- rngVarEnv binds ] + [ (cg_id b, b) | b <- varEnvElts binds ] setBinds $ mkVarEnv bs' freeStackSlots dead_stk_slots \end{code} @@ -486,6 +489,6 @@ getLiveStackSlots :: FCode [VirtualSpOffset] getLiveStackSlots = do { binds <- getBinds ; return [off | CgIdInfo { cg_stb = VirStkLoc off, - cg_rep = rep } <- rngVarEnv binds, + cg_rep = rep } <- varEnvElts binds, isFollowableArg rep] } \end{code}