X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FPprCmmZ.hs;h=0359fe2bd223f8271191b20b136fb25631a36649;hb=5a5557b62bc10c97c58c37bc480a55afb3012175;hp=18302d89e2cd2b994fcad878ee9c369eef5c9d74;hpb=b822c1e46cd64d1dba23fbab0f775b731bf0f12b;p=ghc-hetmet.git diff --git a/compiler/cmm/PprCmmZ.hs b/compiler/cmm/PprCmmZ.hs index 18302d8..0359fe2 100644 --- a/compiler/cmm/PprCmmZ.hs +++ b/compiler/cmm/PprCmmZ.hs @@ -4,8 +4,6 @@ module PprCmmZ ) where -#include "HsVersions.h" - import Cmm import CmmExpr import ForeignCall @@ -47,13 +45,12 @@ pprCmmGraphLikeCmm g = vcat (swallow blocks) last id prev' out l n = let endblock stmt = block' id (stmt : prev') : swallow n in case l of - G.LastBranch tgt [] -> + G.LastBranch tgt -> case n of Z.Block id' t : bs | tgt == id', unique_pred id' -> tail id prev' out t bs -- optimize out redundant labels _ -> endblock (ppr $ CmmBranch tgt) - l@(G.LastBranch {}) -> endblock $ with_out out l l@(G.LastCondBranch expr tid fid) -> let ft id = text "// fall through to " <> ppr id in case n of @@ -84,7 +81,7 @@ pprCmmGraphLikeCmm g = vcat (swallow blocks) let call = CmmCall tgt' ress args (CmmSafe srt) CmmMayReturn tgt' = CmmCallee tgt (cconv_of_conv conv) delayed = - ptext SLIT("// delayed CopyIn follows previous call") + ptext (sLit "// delayed CopyIn follows previous call") in tail id (delayed : ppr call : prev') Nothing t bs | otherwise -> endblock $ with_out out l findCopyIn (Z.ZTail (G.CopyIn _ ress srt) _) = Just (ress, srt) @@ -113,16 +110,18 @@ pprCmmGraphLikeCmm g = vcat (swallow blocks) cconv_of_conv (G.ConventionPrivate {}) = CmmCallConv -- XXX totally bogus with_out :: Maybe (G.Convention, CmmActuals) -> G.Last -> SDoc -with_out Nothing l = ptext SLIT("??no-arguments??") <+> ppr l +with_out Nothing l = ptext (sLit "??no-arguments??") <+> ppr l with_out (Just (conv, args)) l = last l where last (G.LastCall e k) = - hcat [ptext SLIT("... = foreign "), + hcat [ptext (sLit "... = foreign "), doubleQuotes(ppr conv), space, ppr_target e, parens ( commafy $ map ppr args ), - ptext SLIT(" \"safe\""), - case k of Nothing -> ptext SLIT(" never returns") + ptext (sLit " \"safe\""), + case k of Nothing -> ptext (sLit " never returns") Just _ -> empty, semi ] + last (G.LastReturn) = ppr (CmmReturn args) + last (G.LastJump e) = ppr (CmmJump e args) last l = ppr (G.CopyOut conv args) $$ ppr l ppr_target (CmmLit lit) = pprLit lit ppr_target fn' = parens (ppr fn')