+with_out :: Maybe (G.Convention, CmmActuals) -> G.Last -> SDoc
+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 "),
+ doubleQuotes(ppr conv), space,
+ ppr_target e, parens ( commafy $ map ppr args ),
+ 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')
+ commafy xs = hsep $ punctuate comma xs