Commit 4b9be1db authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Small refactoring

parent 9bebd4ea
......@@ -254,7 +254,7 @@ pprStmt platform stmt = case stmt of
pprCFunType :: SDoc -> CCallConv -> [HintedCmmFormal] -> [HintedCmmActual] -> SDoc
pprCFunType ppr_fn cconv ress args
= res_type ress <+>
parens (text (ccallConvAttribute cconv) <> ppr_fn) <>
parens (ccallConvAttribute cconv <> ppr_fn) <>
parens (commafy (map arg_type args))
where
res_type [] = ptext (sLit "void")
......
......@@ -509,10 +509,7 @@ mkFExportCBits dflags c_nm maybe_target arg_htys res_hty is_IO_res_ty cc
int64TyConKey, word64TyConKey]
-- Now we can cook up the prototype for the exported function.
pprCconv = case cc of
CCallConv -> empty
StdCallConv -> text (ccallConvAttribute cc)
_ -> panic ("mkFExportCBits/pprCconv " ++ showPpr cc)
pprCconv = ccallConvAttribute cc
header_bits = ptext (sLit "extern") <+> fun_proto <> semi
......
......@@ -175,9 +175,9 @@ Generate the gcc attribute corresponding to the given
calling convention (used by PprAbsC):
\begin{code}
ccallConvAttribute :: CCallConv -> String
ccallConvAttribute StdCallConv = "__attribute__((__stdcall__))"
ccallConvAttribute CCallConv = ""
ccallConvAttribute :: CCallConv -> SDoc
ccallConvAttribute StdCallConv = text "__attribute__((__stdcall__))"
ccallConvAttribute CCallConv = empty
ccallConvAttribute (CmmCallConv {}) = panic "ccallConvAttribute CmmCallConv"
ccallConvAttribute (PrimCallConv {}) = panic "ccallConvAttribute PrimCallConv"
\end{code}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment