From: simonmar Date: Thu, 6 Apr 2000 13:37:10 +0000 (+0000) Subject: [project @ 2000-04-06 13:37:10 by simonmar] X-Git-Tag: Approximately_9120_patches~4795 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=3c0dfadf8fc761cb9cbf3c06301f9a2ecc2f2e51;p=ghc-hetmet.git [project @ 2000-04-06 13:37:10 by simonmar] fix ccall argument ordering --- diff --git a/ghc/compiler/absCSyn/PprAbsC.lhs b/ghc/compiler/absCSyn/PprAbsC.lhs index 7c869bf..24b0ff8 100644 --- a/ghc/compiler/absCSyn/PprAbsC.lhs +++ b/ghc/compiler/absCSyn/PprAbsC.lhs @@ -346,7 +346,7 @@ pprAbsC stmt@(CCallTypedef is_tdef (CCall op_str is_asm may_gc cconv) results ar -- the first argument will be the "I/O world" token (a VoidRep) -- all others should be non-void non_void_args = - let nvas = tail args + let nvas = init args in ASSERT (all non_void nvas) nvas -- there will usually be two results: a (void) state which we @@ -798,9 +798,10 @@ pprCCall call@(CCall op_str is_asm may_gc cconv) args results vol_regs | otherwise = ( pp_basic_saves $$ pp_saves, pp_basic_restores $$ pp_restores) - non_void_args = let nvas = take (length args - 1) args - in ASSERT2 ( all non_void nvas, pprCCallOp call <+> hsep (map pprAmode args) ) - nvas + non_void_args = + let nvas = init args + in ASSERT2 ( all non_void nvas, pprCCallOp call <+> hsep (map pprAmode args) ) + nvas -- the last argument will be the "I/O world" token (a VoidRep) -- all others should be non-void