X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FPprCmm.hs;h=9f622c0a643fb7d595aaaf53a8c9610c1f80a80e;hb=2bb3a439c106935d97fae7f7a0b60c21493d1bef;hp=4478dfd966d72cf3d222b6c0f1d934969c1c8696;hpb=176fa33f17dd78355cc572e006d2ab26898e2c69;p=ghc-hetmet.git diff --git a/compiler/cmm/PprCmm.hs b/compiler/cmm/PprCmm.hs index 4478dfd..9f622c0 100644 --- a/compiler/cmm/PprCmm.hs +++ b/compiler/cmm/PprCmm.hs @@ -42,10 +42,10 @@ import BlockId import Cmm import CmmUtils import CLabel +import BasicTypes import ForeignCall -import Unique import Outputable import FastString @@ -56,7 +56,7 @@ import Data.Maybe -- Temp Jan08 import SMRep import ClosureInfo -#include "../includes/StgFun.h" +#include "../includes/rts/storage/FunTypes.h" pprCmms :: (Outputable info, Outputable g) => [GenCmm CmmStatic info g] -> SDoc @@ -125,7 +125,7 @@ pprTop :: (Outputable d, Outputable info, Outputable i) pprTop (CmmProc info lbl params graph ) - = vcat [ pprCLabel lbl <> parens (commafy $ map ppr params) <+> lbrace + = vcat [ pprCLabel lbl <> parens (commafy $ map ppr params) , nest 8 $ lbrace <+> ppr info $$ rbrace , nest 4 $ ppr graph , rbrace ] @@ -154,13 +154,14 @@ instance Outputable CmmSafety where pprInfo :: CmmInfo -> SDoc pprInfo (CmmInfo _gc_target update_frame CmmNonInfoTable) = vcat [{-ptext (sLit "gc_target: ") <> - maybe (ptext (sLit "")) pprBlockId gc_target,-} + maybe (ptext (sLit "")) ppr gc_target,-} ptext (sLit "update_frame: ") <> maybe (ptext (sLit "")) pprUpdateFrame update_frame] pprInfo (CmmInfo _gc_target update_frame - (CmmInfoTable (ProfilingInfo closure_type closure_desc) tag info)) = + (CmmInfoTable stat_clos (ProfilingInfo closure_type closure_desc) tag info)) = vcat [{-ptext (sLit "gc_target: ") <> - maybe (ptext (sLit "")) pprBlockId gc_target,-} + maybe (ptext (sLit "")) ppr gc_target,-} + ptext (sLit "has static closure: ") <> ppr stat_clos <+> ptext (sLit "update_frame: ") <> maybe (ptext (sLit "")) pprUpdateFrame update_frame, ptext (sLit "type: ") <> pprLit closure_type, @@ -228,7 +229,7 @@ pprUpdateFrame (UpdateFrame expr args) = -- lbl: stmt ; stmt ; .. pprBBlock :: Outputable stmt => GenBasicBlock stmt -> SDoc pprBBlock (BasicBlock ident stmts) = - hang (pprBlockId ident <> colon) 4 (vcat (map ppr stmts)) + hang (ppr ident <> colon) 4 (vcat (map ppr stmts)) -- -------------------------------------------------------------------------- -- Statements. C-- usually, exceptions to this should be obvious. @@ -275,7 +276,7 @@ pprStmt stmt = case stmt of pprStmt (CmmCall (CmmCallee (CmmLit lbl) CCallConv) results args safety ret) where - lbl = CmmLabel (mkForeignLabel (mkFastString (show op)) Nothing False) + lbl = CmmLabel (mkForeignLabel (mkFastString (show op)) Nothing False IsFunction) CmmBranch ident -> genBranch ident CmmCondBranch expr ident -> genCondBranch expr ident @@ -302,7 +303,7 @@ instance (Outputable a) => Outputable (CmmHinted a) where -- genBranch :: BlockId -> SDoc genBranch ident = - ptext (sLit "goto") <+> pprBlockId ident <> semi + ptext (sLit "goto") <+> ppr ident <> semi -- -------------------------------------------------------------------------- -- Conditional. [1], section 6.4 @@ -314,7 +315,7 @@ genCondBranch expr ident = hsep [ ptext (sLit "if") , parens(ppr expr) , ptext (sLit "goto") - , pprBlockId ident <> semi ] + , ppr ident <> semi ] -- -------------------------------------------------------------------------- -- A tail call. [1], Section 6.9 @@ -381,7 +382,7 @@ genSwitch expr maybe_ids in hsep [ ptext (sLit "case") , hcat (punctuate comma (map int is)) , ptext (sLit ": goto") - , pprBlockId (head [ id | Just id <- ids]) <> semi ] + , ppr (head [ id | Just id <- ids]) <> semi ] -- -------------------------------------------------------------------------- -- Expressions @@ -514,6 +515,8 @@ pprLit lit = case lit of CmmLabelOff clbl i -> pprCLabel clbl <> ppr_offset i CmmLabelDiffOff clbl1 clbl2 i -> pprCLabel clbl1 <> char '-' <> pprCLabel clbl2 <> ppr_offset i + CmmBlock id -> ppr id + CmmHighStackMark -> text "" pprLit1 :: CmmLit -> SDoc pprLit1 lit@(CmmLabelOff {}) = parens (pprLit lit) @@ -614,12 +617,6 @@ pprSection s = case s of where section = ptext (sLit "section") --- -------------------------------------------------------------------------- --- Basic block ids --- -pprBlockId :: BlockId -> SDoc -pprBlockId b = ppr $ getUnique b - ----------------------------------------------------------------------------- commafy :: [SDoc] -> SDoc