X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fcmm%2FCmmCallConv.hs;fp=compiler%2Fcmm%2FCmmCallConv.hs;h=7b3dd0d83f82bf7950884ed0cfe9a70dcdc06a89;hp=7c671077f0d1193407769a7f3cceebfff64dd76f;hb=8e9c95ac7ad62c5ce6d39e52ac8da6936f19da4c;hpb=617eb195e67525ffda967099fa8d9899e2b15ce8 diff --git a/compiler/cmm/CmmCallConv.hs b/compiler/cmm/CmmCallConv.hs index 7c67107..7b3dd0d 100644 --- a/compiler/cmm/CmmCallConv.hs +++ b/compiler/cmm/CmmCallConv.hs @@ -54,24 +54,36 @@ assignArgumentsPos :: (Outputable a) => Convention -> Bool -> (a -> CmmType) -> ArgumentFormat a ByteOff assignArgumentsPos conv isCall arg_ty reps = map cvt assignments where -- The calling conventions (CgCallConv.hs) are complicated, to say the least - regs = if isCall then - case (reps, conv) of - (_, NativeNodeCall) -> getRegsWithNode - (_, NativeDirectCall) -> getRegsWithoutNode - (_, GC ) -> getRegsWithNode - (_, PrimOpCall) -> allRegs - (_, Slow ) -> noRegs - _ -> pprPanic "Unknown calling convention" (ppr conv) - else - case (reps, conv) of - ([_], _) -> allRegs - (_, NativeNodeCall) -> getRegsWithNode - (_, NativeDirectCall) -> getRegsWithoutNode - (_, NativeReturn) -> getRegsWithNode - (_, GC ) -> getRegsWithNode - (_, PrimOpReturn) -> getRegsWithNode - (_, Slow ) -> noRegs - _ -> pprPanic "Unknown calling convention" (ppr conv) + regs = case (reps, conv) of + (_, NativeNodeCall) -> getRegsWithNode + (_, NativeDirectCall) -> getRegsWithoutNode + ([_], NativeReturn) -> allRegs + (_, NativeReturn) -> getRegsWithNode + (_, GC) -> getRegsWithNode + (_, PrimOpCall) -> allRegs + ([_], PrimOpReturn) -> allRegs + (_, PrimOpReturn) -> getRegsWithNode + (_, Slow) -> noRegs + _ -> pprPanic "Unknown calling convention" (ppr conv) + -- regs = if isCall then + -- case (reps, conv) of + -- (_, NativeNodeCall) -> getRegsWithNode + -- (_, NativeDirectCall) -> getRegsWithoutNode + -- (_, GC ) -> getRegsWithNode + -- (_, PrimOpCall) -> allRegs + -- (_, Slow ) -> noRegs + -- _ -> pprPanic "Unknown calling convention" (ppr conv) + -- else + -- case (reps, conv) of + -- (_, NativeNodeCall) -> getRegsWithNode + -- (_, NativeDirectCall) -> getRegsWithoutNode + -- ([_], NativeReturn) -> allRegs + -- (_, NativeReturn) -> getRegsWithNode + -- (_, GC) -> getRegsWithNode + -- ([_], PrimOpReturn) -> allRegs + -- (_, PrimOpReturn) -> getRegsWithNode + -- (_, Slow) -> noRegs + -- _ -> pprPanic "Unknown calling convention" (ppr conv) -- (_, NativeCall) -> getRegsWithoutNode -- (_, GC ) -> getRegsWithNode -- (_, PrimOpCall) -> allRegs